refactor(server): decompose request routing#550
Open
Graffioh wants to merge 2 commits into
Open
Conversation
Graffioh
force-pushed
the
codex/extract-request-sampler-parsing
branch
3 times, most recently
from
July 20, 2026 19:05
8a9717b to
5a24337
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LgRW2HdErpbMYgp94DzMSq
Graffioh
force-pushed
the
codex/extract-request-sampler-parsing
branch
from
July 20, 2026 19:18
5a24337 to
972e795
Compare
Graffioh
marked this pull request as ready for review
July 21, 2026 06:57
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
/v1/chat/completions and /v1/messages accepted bodies without a messages array and generated from an empty conversation (pre-existing: the old non-const operator[] silently inserted null). Validate the field explicitly and fail with 400; count_tokens keeps its tolerant array default. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LgRW2HdErpbMYgp94DzMSq
Graffioh
force-pushed
the
codex/extract-request-sampler-parsing
branch
from
July 21, 2026 08:37
5fbf7b2 to
a0d310b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
route_request()into focused helpers for common fields, endpoint payloads, reasoning settings, prompt preparation, validation, and dispatch.route_request()as a small coordinator while preserving the existing API behavior.Example
Before, adding or changing an API-specific field meant editing the same large function that also rendered prompts and queued inference. Now endpoint adaptation stays in
parse_endpoint_request(), while the shared request pipeline remains unchanged.Testing
git diff --check