PR #638 — "Echo Responses tools and text.format and decode tool output is_error"
Fixes #450. Open, ready for review, 9 files, +1316/−33, head f414393, base main, opened 2026-11-30.
Key findings
- CI is red on the head commit
f414393, and the PR description never mentions it. The description claimscargo test --releaseresults of 1,805 passed / 0 failed (helios), 245 (flare) and 227 (flare-cli). The orientation packet records CI failed on that same head. Nothing in the body explains the discrepancy — this is the single most checkable gap (see Claims & evidence). - The description's prompt-compatibility claim is narrower than written. It says "namespaced tool prompts render identically to before". On
main,decode.rs:853-855concatenated the namespace description into the tool description unconditionally, so an empty or absent namespace description prepended a bare"\n"to the tool description. PR #638 filters empty toNone(decode.rs:912-916) and prepends only when nonempty (request.rs:520-527), so for empty/absent namespace descriptions the rendered prompt changes versusmain— a prefix-cache-visible change for any long-lived client sending such requests. - Six new HTTP 400 rejections are introduced but only the GET-route 400 is documented. New rejects: duplicate namespace name (
decode.rs:909-911), non-objecttext, non-objecttext.format,json_schemawith missing/invalidschema, invalidname/description, non-booleanstrict.docs/api.mdgained only a 3-line GET-400 sentence and a 7-line echo/is_errorparagraph — the namespace-duplicate rule and thetext.formatvalidation/echo-metadata rules are absent. - The echo is semantically, not byte-, faithful to the request. Custom-tool
formatis reconstructed from the stored grammar (encode.rs:23-37), function tools always echostricteven when the client omitted it and echoparameters: nullwhen undeclared (encode.rs:38-48), and an emptydescriptionis dropped on tool entries (encode.rs:50-52) yet echoed as""on namespace entries (encode.rs:320). A client diffing request vs response sees differences. The PR's own test asserts the right invariant (decode of re-encoded == decode of original), not byte equality. - The upstream issue is young and small. #450 was opened 2026-11-21 by shieldstar, triaged by yatesdr the same day (items 1 and 2 "Confirmed", item 3 "Documented"), confirmed by flare-autobot on 2026-11-30, and the PR lands the same day. There is no long-running demand behind it.
- The PR also fixes three defects #450 never reported: duplicate namespace names accepted in one request; namespace-description concatenation producing a leading newline;
json_schemametadata (name/description/strict) silently dropped and schema shape validated only at grammar compilation. These are the changes most likely to change behaviour for existing clients. - Nothing is superseded, reverted or competed with, but #548/#560 (open) edit the same
Encoder::response()literal (encode.rs:818) and #637 (same author, same day) edits the sameprotocol/tests.rsanddocs/api.md— rebase conflict, not semantic conflict. - Charter fit is strong: the change enforces the charter's own "Don't silently ignore API fields … either implement it according to the spec or reject it (#417)" rule against
main's behaviour, and stays in the shared protocol layer with no per-model branch.
1. The change: what it does and how big
Size. 9 files, +1316/−33. Tests are +925 of that (helios/src/server/protocol/tests.rs +683, helios/src/server/runtime/phase_tests.rs +242), so production + docs is ~391 lines across 7 files. Neighbours for scale: #637 (same author, same day) +881/−7 with +454 tests; #626 +1405/−39.
Files: docs/api.md +10/−2, helios/src/server/http.rs +21/−1, helios/src/server/inference.rs +1/−0, protocol/decode.rs +282/−27, protocol/encode.rs +63/−1, protocol/mod.rs +1/−0, protocol/tests.rs +683/−0, request.rs +13/−2, runtime/phase_tests.rs +242/−0.
Verified behaviours, by file:
protocol/encode.rs— newresponses_tool_entry()(encode.rs:23-54) serializes custom tools as{type:"custom",name,format:{type:"grammar",syntax,definition}|{type:"text"}}and function tools as{type:"function",name,parameters|null,strict}, addingdescriptiononly when nonempty. Newresponses_tools()(encode.rs:306-329) groups tools byTool.namespacein first-appearance order, emitting{type:"namespace",name,description,tools:[…]}.Encoder::response()now emits"tools":self.responses_tools(),"text":{"format":self.text_format}(encode.rs:818) wheremainhad the literal"tools":[],"text":{"format":{"type":"text"}}(encode.rs:756onmain).Encodergains atext_format: Valuefield defaulting to{"type":"text"}withset_text_format()(encode.rs:191).- SSE coverage —
response.createdandresponse.in_progressboth derive fromresponse()(encode.rs:294-300), and the terminal frames (response.completed/response.incompleteatencode.rs:818,response.failedatencode.rs:822-827) route through the same literal, so all five lifecycle frames carry the echo. inference.rs:61—pub namespace_description: Option<String>added toTool. This is a plain Rust struct field, not a Protobuf/serde wire type.protocol/decode.rs—is_error: flag(&item,"is_error",false)?replaces the literalfalsefor Responses tool outputs (decode.rs:343);tool()setsnamespace_description: None(decode.rs:442); newresponses_text_format()(decode.rs:466-503) validates and echoes;options()now returns(Options, Value)and only setsoptions.constraintwhen a format is present (decode.rs:549-563);decode()rejects duplicate namespace names and reads/normalizesnamespace_description(decode.rs:903-926).protocol/mod.rs—Decodedgainstext_format: Value.request.rs:517-533—template_inputs()prepends a nonemptynamespace_descriptionbefore the tool description and before custom-tool grammar instructions.http.rs—generate()callsencoder.set_text_format(decoded.text_format)athttp.rs:371;no_websocket()(http.rs:19-25) now says "GET /v1/responses and WebSocket transport are not supported; use POST /v1/responses with HTTP JSON or SSE".docs/api.md— the GET-400 sentence in "Transport and admission" (diff hunk @@ −228,+231) and the echo/is_errorparagraph in "Stateless Responses" (@@ −729,+736).
Undeclared or under-declared in the diff (what the description does not say)
- Prompt change for empty namespace descriptions (Key finding 2, above):
maindecode.rs:853-855vs PRdecode.rs:912-916+request.rs:520-527. - The
grammar/text.formatexclusion semantics shifted. Onmainthe check wasif present(body,"grammar") { if !format.is_null() { … } }. Now the gate ishas_format(decode.rs:586-591), which for Responses isresponses_format.is_some()(decode.rs:559). Consequence:text: {"format": {"type":"text"}}(explicitly text) does conflict withgrammar, while omitted/nulltext.formatdoes not — accepted and documented in the PR body, but it is a rule change, andtext: {}also defaults to text (covered by a test, not by docs). strictis echoed even when the client omitted it, anddescriptionis dropped when empty, soresponse.toolsis not a mirror ofrequest.tools.response.toolsnamespace entries always carrydescription, as""when absent (encode.rs:320), unlike tool entries which omit empty descriptions.- New rejections are not in
docs/api.md(Key finding 3).docs/api.md:571-572still only says namespaces becomenamespace__namenames "and ambiguous names are rejected" — the duplicate-namespace 400 is not described there either. - An internal two-function invariant:
responses_text_format()guarantees the type, andoptions()re-matchesformat["type"].as_str().unwrap()with_ => unreachable!()(decode.rs:552-556). Correct today, but it is a panic path guarded only by convention, not the "single-pass" helper the description implies.
Declared but not present
Nothing found — every item the description claims exists in the diff. Its "no Protobuf schema, model core format, cache layout, scheduler, or CUDA graph contract changes" claim checks out: the inference.rs change is one struct field; no grammar.rs, runtime.rs (not opened), scheduler or graph file is touched.
2. The why: the problem and its provenance
- #450 (
/v1/responsesecho omits the request's tools and always reportstext.format: text; tool outputs …), opened 2026-11-21 by shieldstar, still open, labelledarea:api+bug. It is the only issue #638 claims ("Fixes #450") and the only one that appears on the PR. - The report is a full reproducer: four modules added to helios at commit
25b49519, all passing, showingwire_tools=[],wire_text={"format":{"type":"text"}}alongsidetool_choice="required", Responsestool_resultflags[false,false]vs Chat[true], andGET /v1/responses→ 400 "WebSockets are not supported…". Source pointers given:encode.rs:692(Responses arm on that commit),decode.rs:311-318(is_errorliteral at:316),decode.rs:170/:227(Chat/Messages read the flag),server.rs:533(not opened) (route),http.rs:19-25. - yatesdr triage, 2026-11-21 18:38: item 1 and item 2 "Confirmed"; item 3 "Documented" — i.e. a maintainer read the GET 400 as intentional (WebSocket transport is unsupported) with only the wording at fault. So one third of #450 is a documentation/wording fix in the maintainer's own framing, not a product defect.
- flare-autobot, 2026-11-30 11:41 confirmed the defects on
origin/mainatc146d7beand pre-announced PR #638. Same-day turnaround. - Age and width of demand: the issue is ~9 days old at PR open, has one reporter and two comments. No evidence of a longer or wider want for this specific fix.
- Defect age: the hardcoded
"tools":[]/text.formatliteral predates #450. That Responses arm was last meaningfully changed by #333 (yatesdr,parallel_tool_calls) and #170 (mark-yong, usage echo); the literal itself dates to the original protocol work99cfcd5b(Luke Alonso, 2026-10-13, "Add native LLM API protocols and reject zero temperature"). So the echo defect has existed since the Responses endpoint was introduced, ~7 weeks. - One part of #450 was already fixed before this PR:
tests/server/test_protocols.py:618assertsstrict: trueon a Responses function tool returns 400, reflecting the pre-#418 state; #418 (merged 2026-11-22) added strict tool support, which is why #638's echo now has astrictfield to serialize.
3. Related work
Overlapping open PRs (same files, conflict risk):
| PR | Author | Files shared with #638 | Nature of overlap |
|---|---|---|---|
| #548 Add per-request histograms and vLLM-parity request metrics | WynnD | docs/api.md, http.rs, protocol/encode.rs, protocol/tests.rs, runtime/phase_tests.rs |
Adds Encoder fields/methods; edits protocol/tests.rs |
| #560 Emit vLLM-compatible per-request metrics from runtime instants (stacked on #548) | WynnD | same, 5 in common | Adds Encoder::record_times/metrics_value and attaches metrics to response.completed/response.incomplete — the same json! literal #638 rewrites at encode.rs:818 |
#458 Restore Responses SSE sequence_number when Encoder::apply/finish fails |
brandonmmusic-max | protocol/encode.rs |
Adjacent (SSE frame sequencing), no textual overlap with the tools/text literal |
| #637 Bound synthesized tool-call IDs to 37 characters across HTTP protocols | flare-autobot (same author, same day) | protocol/tests.rs, docs/api.md, protocol/decode.rs |
Sibling from the same batch; +881/−7; both append to the shared test module — likely textual conflict |
| #483, #554, #625 | various | 3–4 files in common per orientation packet | Unrelated subject matter; file overlap only |
Merged work #638 builds on: #418 (jcartu, merged 2026-11-22) strict function-tool schemas — added Tool.strict and the strict reject rule at decode.rs:399-402, which #638's echo is the first code to serialize back to a client; #333 (yatesdr) parallel_tool_calls; #170 (mark-yong) Responses/Chat usage echo; #167 (yatesdr) reasoning budget + DeepSeek ranges.
Superseded / undone: nothing found. #638 does not revert, replace or compete with any other item.
Related pressure it is adjacent to: #417 (closed issue) "Support strict: true function tools (currently rejected with HTTP 400)" and #447 (open issue, synthesized tool-call IDs >40 chars — being fixed separately by #637). Neither requires #638.
4. Recent activity in the areas it touches
- Exactly one main commit since branching (
c146d7b) touches these files:0a8c20f4/ #626 (Luke Alonso, merged 2026-11-30 02:39) — "Allow speculative reasoning for grammar-constrained requests". It addsPrompt::grammar_reasoningaroundrequest.rs:408,441and speculative-grammar phase tests atruntime/phase_tests.rs:7301-8068. #638 changesrequest.rs:517-533(template_inputs), a different function region — no textual conflict — but #638 neither builds on it nor mentions it. - Other recent helios/docs commits (#620, #540, #586, #619, #615, #582, #618) share files but not code regions; #615 (Frosty40) previously touched
decode.rs/request.rs/docs/api.mdforthinking_token_budget. - Author-frequency context: in the last 180 days
helios/srchas 229 commits from Luke Alonso, 52 from Martin Vit, 47 from yatesdr;docs/similar. #638's most recent non-autobot predecessors in these exact files are Frosty40 (#615) and jcartu (#418). - No conflict with, reversal of, or dependency on any of the above was identified.
5. People
- GitHub author/opener:
flare-autobot(COLLABORATOR). The git commit author for headf4143935is "derek" — the same name/handle that authored earlier helios logprobs commits (48bae6bb,2a65f7f3,7c805294). Commit messages follow the house style, ending "Discord: flare-autobot". - Standing: flare-autobot's 180-day record in this repo is 0 merged, 0 closed, 2 open (#637, #625). This account has no merged history in that window; the review traffic such PRs get is the project's own Autobot Review (e.g. #626 received one, with "Changes Requested" citing a failing CI on its head — the same pattern likely here).
- Who normally works here: Luke Alonso (229 commits in
helios/src), Martin Vit (52), yatesdr (47). Recent protocol-level contributors: jcartu (#418), yatesdr (#333, #167), mark-yong (#170), Frosty40 (#615). - Engaged so far on #638: nobody. Zero comments, zero reviews, no labels. The only cross-reference anywhere is flare-autobot's own comment on #450 announcing the PR. The issue's most authoritative human input remains yatesdr's triage.
6. Community
- PR #638: 0 comments, 0 reviews, no labels, opened and last updated the same day (2026-11-30). No expressed interest, positive or negative.
- Issue #450: 2 comments (yatesdr's triage, flare-autobot's confirmation), 1 reporter (shieldstar).
- No reactions, no linked discussions, no downstream issue reproductions found. Nothing indicates this is a widely demanded fix; equally nothing indicates objection.
- The nearest evidence of real client pressure in this area is #417 (strict tools rejected, blocker for pydantic-ai users), which #638 is adjacent to but not required by.
7. Project fit (charter, roadmap, docs)
Lines up:
- Charter Goal: "Support the documented Chat Completions, Completions, Responses, and Messages APIs (including token counting)", and Standards: "We target the documented subset of the OpenAI API … and JSON Schema for structured outputs". Echoing
tools/text.formatper the Responses contract and honouringis_errorsit squarely inside that. - Charter rule: "Don't silently ignore API fields. If a standard request field is passed in, either implement it according to the spec or reject it. Never accept it and quietly drop it (#417)" —
mainacceptedis_errorandtext.formatmetadata and dropped it. #638 implements rather than drops; the new 400s are the "reject" half of the same rule. This is the strongest charter alignment in the PR. - "Keep the runtime small and model-agnostic … shouldn't accumulate per-model branches (#267, #334)" — all changes are in
helios/src/server/protocol/*+request.rs, no per-model branch. - "What gets merged: PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs" — #450 is a reproducible bug with maintainer confirmation, and the
GEThalf is "bad docs". - "PR descriptions: Expect four parts: why / what changed / claimed result / evidence" — present and unusually thorough.
- Nothing here touches the Non-Goals (no new aliases, hardware, backends, deps, or defaults).
Tension / attention points:
- Charter review standard "Supported matrix & compatibility: … verify that existing data, artifacts, and exported cores still load": no core/export change, consistent with the claim. But the prompt-identity claim (item 2 of Key findings) is a serving-behaviour compatibility claim backed only by CPU fixture tests.
- "Bring real evidence" +
docs/design-review.mdprinciple 12 ("Validate the real path and report evidence honestly"): #638 makes no performance claim, so the GPU-benchmark gate does not bite; the skipped TLA+/kani layers are justified by "no scheduler/lifecycle change", which is consistent with the diff. What is missing is live-served evidence for the HTTP contract it changes. - "Respect contributors" / priority-contributor weighting is not engaged — the author is the automation account, not a priority contributor.
8. Claims and evidence
| Claim | Backing | Verdict |
|---|---|---|
Echo of declared tools + text.format in buffered and all SSE lifecycle frames |
encode.rs:306-329, encode.rs:818, encode.rs:294-300, encode.rs:822-827; tests protocol/tests.rs:2671 (responses_tools_echo_and_round_trip_standalone_custom_and_namespaces), protocol/tests.rs:3127-3133, runtime/phase_tests.rs:4696 (production http::generate, buffered + streamed) |
Backed in code and CPU tests |
Malformed text/text.format, non-boolean is_error, duplicate namespaces → HTTP 400 before model admission |
decode.rs:466-503, decode.rs:909-911, decode.rs:343; tests protocol/tests.rs:3136-3200+, runtime/phase_tests.rs:4696 |
Backed |
is_error lowers identically to Chat and Messages across Jinja / DeepseekV4 / DeepseekV41 / TmlV0, incl. multimodal |
decode.rs:2262 (responses_tool_result_is_error_matches_chat_and_messages_across_prompt_encoders, decode.rs:2261-2440) renders all four frontends, asserts text/token-id/image parity plus Tool execution failed: and `< |
content_tool_error |
| 1,805 helios / 245 flare / 227 flare-cli passed, 0 failed | Claimed only; CPU aarch64 release; not reproduced here. Consistent with neighbours (#626 claims 1,806, #637 claims 1,803 on the same suite at the same time) | Claimed, plausible, unverified |
"Expected but unmeasured: OpenAI Python SDK v2 Pydantic deserialization of echoed response.tools/response.text" |
Nothing. tests/server/test_protocols.py was not extended: it still asserts only response.tool_choice == "required" / parallel_tool_calls / output items (test_protocols.py:386-401) and still only checks the GET status code (test_protocols.py:623) |
Declared unmeasured — the one claim a reviewer cannot check from the diff |
Per-request storage bounded by max_body_bytes (32 MiB default); serialized on lifecycle envelopes, not per delta; dropped at completion |
True by construction — both derive from the body, and response() is not on the per-token delta path |
Reasonable |
| No Protobuf / core / cache / scheduler / CUDA changes; existing cores load unchanged | Verified: inference.rs:61 is a Rust-only field; no grammar/runtime/scheduler file touched |
Backed |
| "Namespaced tool prompts render identically to before" | Holds when the namespace description is nonempty; false for empty/absent descriptions, where main's leading "\n" disappears (decode.rs:853-855 main vs request.rs:520-527) |
Imprecise |
| CI green | Not claimed at all; CI on f414393 failed per the orientation packet. Local claims of 1,805 passing vs a red CI on the same head is the sharpest unexplained discrepancy |
Unexplained |
9. Reach: who and what is affected
Users:
- Anyone reading back an OpenAI Responses object — Pydantic SDK deserialization, gateways, agent frameworks that re-serialize history — now receives real
tools/textinstead of placeholders. This is the intended fix. - Anyone replaying failed tool results through
/v1/responsesnow gets error signalling identical to Chat Completions and Messages, across all four prompt encoders. Non-error results are unchanged. - Clients that only read
output/usageare unaffected except for a slightly largerresponseobject on every SSE lifecycle frame.
Prompt / prefix cache:
- Nonempty namespace descriptions: rendered prompt identical to
main(the"{prefix}\n{description}"shape is preserved, including position before custom-tool grammar instructions). - Empty/absent namespace descriptions: rendered prompt changes (the leading newline disappears) — prefix-cache misses for long-lived clients in that case. Neither the description nor the docs call this out; the description asserts identity.
- Failed tool results now render error tokens, which the description acknowledges ("prefix caching naturally separates error and non-error trajectories"). That is correct behaviour but it does mean previously-cached successful trajectories and new error trajectories diverge — as they should.
New rejections of previously-accepted requests (strictness increase on a documented surface): duplicate namespace names; text not an object; text.format not an object; json_schema without an object-or-boolean schema; non-string name/description; non-boolean strict; grammar together with an explicitly-text text.format. On main most were ignored or failed later at grammar compilation. Defensible under the charter's #417 rule, but undocumented for every case except the grammar exclusion implied by the existing docs.
Operators / configuration: no new flags, config keys, defaults, or dependencies. No packaging, Orbit, Ignition or CLI impact.
Compatibility: no Protobuf, no core format, no exported-core change (the inference.rs diff is one Rust struct field), so existing cores load unchanged as claimed.
Documentation: docs/api.md gains 3 lines in "Transport and admission" and 7 lines in "Stateless Responses" (GET-400 wording, echo contract, is_error defaulting). Not documented: the duplicate-namespace 400, the text.format validation table, the echoed json_schema metadata (name/description/strict), and the fact that strict is always echoed and empty description dropped.
Test surface: tests/server/test_protocols.py (the served SDK contract suite) untouched — so none of this is validated end-to-end against a live server or a real SDK.
10. Process
- State: OPEN, not a draft, marked ready for review. Base
main, headf414393. Opened and last updated 2026-11-30 (same day) — age is effectively zero. - CI: failed on the head commit. Not mentioned in the PR body.
- Reviews / comments / labels: none / none / none.
- Main-branch drift: one commit (#626) touched these files since branching; not acknowledged in the description.
- Verification shape: strong CPU unit/integration coverage (6 new tests, ~925 test lines), no live-server evidence, no SDK evidence, no
tests/server/test_protocols.pyextension, GPU/checkpoint#[ignore]suites skipped (83 in helios, 4 in flare, 3 in flare-cli — consistent with their default status). - Description quality: thorough and unusually honest about what was not run ("Expected but unmeasured", the explicit list of unrun checks), which is itself a positive signal — but the CI result and the prompt-identity nuance are omissions within an otherwise candid body.
Open questions (unanswered by the material)
- Why is CI red on
f414393when the description reports 1,805 / 245 / 227 passing? Same head, so one of the two is about a different environment or a flake. - Does "namespaced tool prompts render identically to before" intend to include the empty/absent namespace-description case, where
main's leading newline disappears? - Should the six new HTTP 400 rejections be documented in
docs/api.mdnext to the new GET-400 sentence, given the PR's own stated goal of specifying the contract there? - Should
tests/server/test_protocols.pygain echoedtools/text.formatandis_errorassertions? It already asserts Responses tool/choice shapes (test_protocols.py:386-401) and the GET status (:623), so the hooks exist. - Does #638 need to acknowledge #626 (merged 2026-11-30 02:39, same files) or state that it does not interact with
Prompt::grammar_reasoning? - Should the echo be byte-faithful to the request (always-echoed
strict, dropped emptydescription, grammar-reconstructed customformat), or is semantic equivalence the intended contract? The PR's tests assume the latter;docs/api.mddoes not say which.
What could not be found
- Any comment, review, reaction or downstream reproduction beyond issue #450's two comments.
- Any stated performance or resource claim to verify (none was made).
- Any evidence that this defect had prior reporters before #450, despite existing since 2026-10-13 (
99cfcd5b). - Any live-server, OpenAI Python SDK v2, or
tests/server/test_protocols.pyevidence for the changed HTTP contract. - Any competing, superseding, or reverting work.