Skip to content

refactor(server): decompose request routing#550

Open
Graffioh wants to merge 2 commits into
Luce-Org:mainfrom
Graffioh:codex/extract-request-sampler-parsing
Open

refactor(server): decompose request routing#550
Graffioh wants to merge 2 commits into
Luce-Org:mainfrom
Graffioh:codex/extract-request-sampler-parsing

Conversation

@Graffioh

@Graffioh Graffioh commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Decompose route_request() into focused helpers for common fields, endpoint payloads, reasoning settings, prompt preparation, validation, and dispatch.
  • Keep route_request() as a small coordinator while preserving the existing API behavior.
  • Retain one focused unit test for sampler defaults and request overrides.

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
  • Unit tests pass

@Graffioh Graffioh changed the title refactor(server): extract request sampler parsing refactor(server): decompose request routing Jul 20, 2026
@Graffioh
Graffioh force-pushed the codex/extract-request-sampler-parsing branch 3 times, most recently from 8a9717b to 5a24337 Compare July 20, 2026 19:05
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LgRW2HdErpbMYgp94DzMSq
@Graffioh
Graffioh force-pushed the codex/extract-request-sampler-parsing branch from 5a24337 to 972e795 Compare July 20, 2026 19:18
@Graffioh
Graffioh marked this pull request as ready for review July 21, 2026 06:57

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/src/server/http_server.cpp Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/src/server/http_server.cpp
/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
Graffioh force-pushed the codex/extract-request-sampler-parsing branch from 5fbf7b2 to a0d310b Compare July 21, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant