Repository navigation
serve: an error about one request field names it in param - #998
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: The changed request validation, error serialization and release packaging have no surviving must-fix finding.
Checked
Duplicates: 5 new functions checked against existing owners; none duplicated. Dryer reported 0 candidate pairs.
Complexity: gen_params rose from 41 to 43 through field attribution in its existing constraint-error branch; no new request behavior branch.
Silent failure: 5 metadata fallback sites followed through JSON and SSE consumers; invalid inputs retain their errors.
Tests (static mutation analysis): removing compiler source attribution at crates/serve/src/constrain/schema.rs:925 fails the stop-text unit test and the error-envelope table. Removing media attribution at crates/serve/src/api.rs:3500 fails the media-error unit test. Dropping input attribution at crates/serve/src/embeddings.rs:562 fails the embedding-input test. Removing Responses renaming at crates/serve/src/responses.rs:254 fails the image-conversion test and envelope table. Dropping empty-prompt attribution at crates/serve/src/api.rs:4130 fails the table. Adding param to the Anthropic envelope at crates/serve/src/anthropic.rs:893 fails its vision-error comparison.
Gates: no threshold, tolerance, lint level or test case removed or relaxed; the PR supplies failure-first output for the new metadata assertions.
Escape catalog: no C1–C4 pattern introduced. Both changed release scripts passed bash -n.
Performance: changes affect request validation, error handling and packaging; no decode or prefill-loop work changes.
Notes
Rust tests were not run in this review. The PR reports two targeted test passes, not a full gate-serve run.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
Every 400 an OpenAI route answers about one request field carries `param`, the field's top-level name, beside llama-server's code, message and type. /v1/responses names its own fields (input, text, reasoning) where the chat body it runs as names others. An error about no single field carries none, and the Anthropic envelope keeps its object without it. docs/serving.md states the rule.
build.sh and build-mac.sh copy docs/serving.md beside LICENSE, and each archive's README names it, so the routes, request fields and error objects read offline.
edff97b to
1374d5a
Compare
There was a problem hiding this comment.
Since the last review: no earlier must-fix or non-blocking items were open.
Verdict: CLEAN: The rebase preserves the shared 404 constructor and its error envelope.
Checked
Duplicates: 0 new definitions in the interdiff. Both functions in the dryer pair were read; invalid and not_found own different status/type pairs.
Complexity: crapper reports gen_params 41 → 43 from field attribution in an existing error branch. That patch is unchanged since the previous review.
Silent failure: 1 metadata initialization followed through serialization. param: None omits metadata; unknown routes, unknown models and missing stored responses still return named 404 errors.
Tests: no test changed in the interdiff. Static mutation check: changing param: None at crates/serve/src/api.rs:1561 to Some("model".to_owned()) fails the /nope assertion in hw_errors_are_openai_objects.
Gates: no gate, case, tolerance or lint changed in the interdiff.
Escape catalog: no C1–C4 pattern matched.
Performance: the interdiff changes error construction and imports; no decode or prefill hot path changes.
Notes
Rust tests were not run in this review. The PR reports targeted test passes, not a full gate-serve run.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
chat completions 계열 경로의 400 오류가 문제의 요청 필드를
param으로 알려 주도록 고치고, 릴리스 압축 파일에 API 레퍼런스(docs/serving.md)를 넣었습니다.What and why
A 400 from a chat completions or responses route about one request field now carries
param, the field's top-level name, beside the code, message and type it already had. A client can read the field instead of parsing the message. A fault inside a field names the field that holds it (messagesformessages[2].content), and a constraint the compiler refuses (response_format,text,tools) keeps the compiler's own message and names its source field./v1/responsesnames its own fields (input,text,reasoning) where the chat body it runs as names others. An error about no single field (a body that is not JSON, a prompt past the context, a full queue) carries none, and the /v1/messages envelope keeps its object without it.docs/serving.mdstates the rule.The second commit makes
build.shandbuild-mac.shcopydocs/serving.mdbesideLICENSE, and each archive's README names it, so the routes, request fields and error objects read offline.The change is in the request parsing and error path of the server (
crates/serve,crates/embed/src/request.rs). No kernel or generation path changes.Release notes: Changed: a 400 from a chat completions or responses route about one request field names it in
param, and the release archives carrydocs/serving.md.Code shape
schema::request) that already owns the three constraint compiles; no helper was added.docs/serving.mdstates theparamcontract the code now meets.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
Before the fix, the stop-id unit test and the error-envelope table test (
hw_errors_are_openai_objects) with the new cases failed on the missingparam:The empty-prompt cases failed on it too:
With the change, on a base of
977e8e74d47c59b00f7672421eecf0a4c32b30d3:cargo fmt --all -- --checkexits 0.The real binary on a DGX Spark, serving Qwen3.8-Flash-Next FP4 (
nvidia__Qwen3.8-Flash-Next-FP4-Local), built forsm_121awith the release feature set oftools/release/build.sh:Requests against it, each answering 400 with the field named:
The gate prints
ERROR-PARAM PASS.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.