Skip to content

Echo Responses tools and text.format and decode tool output is_error - #638

Open
flare-autobot wants to merge 1 commit into
NVIDIA:mainfrom
flare-autobot:fix/issue-450-responses-echo-and-tool-error
Open

flare-autobot wants to merge 1 commit into
NVIDIA:mainfrom
flare-autobot:fix/issue-450-responses-echo-and-tool-error

Conversation

@flare-autobot

@flare-autobot flare-autobot commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #450

Why

Clients calling Helios's OpenAI Responses endpoint (POST /v1/responses) read tools and text.format from returned response objects across buffered JSON replies and Server-Sent Events (SSE) lifecycle frames to confirm active tool declarations and structured-output constraints, and send is_error: true on function_call_output and custom_tool_call_output items to signal failed tool executions to the model. On origin/main, three defects broke those contracts:

  1. Every serialized Responses response object hardcoded "tools": [] and "text": {"format": {"type": "text"}} even when the request declared tools, set "tool_choice": "required" or a named tool, or requested json_object or json_schema output, emitting self-contradictory metadata and misreporting active structured-output constraints.
  2. Responses tool-result input items (function_call_output and custom_tool_call_output) decoded with a hardcoded is_error: false, unlike Chat Completions (/v1/chat/completions) and Anthropic Messages (/v1/messages). Failed tool outputs replayed through /v1/responses therefore lost error signaling across Helios's prompt encoders (Jinja, DeepseekV4, DeepseekV41, and TmlV0).
  3. GET /v1/responses returned HTTP 400 with "WebSockets are not supported; use POST /v1/responses with HTTP/SSE", assuming a WebSocket upgrade even on plain HTTP GET requests and omitting HTTP JSON, while docs/api.md did not specify the route-level HTTP 400 behavior or the Responses echo and is_error rules.

Carrying normalized namespace descriptions on inference::Tool, validating and retaining text.format during protocol decoding, and decoding is_error into the shared Part::ToolResult representation resolves all three defects inside Helios's shared HTTP protocol layer without altering model contracts, prefix-cache mechanics, scheduling, or CUDA graph execution.

What changed

Before:

  • Encoder::response() (helios/src/server/protocol/encode.rs) hardcoded "tools": [] and "text": {"format": {"type": "text"}} for Protocol::Responses.
  • decode() (helios/src/server/protocol/decode.rs) flattened Responses "type": "namespace" tool wrappers by concatenating each namespace's description directly into Tool.description (preventing lossless namespace echoing and adding a leading newline for empty descriptions) and accepted duplicate namespace names in one request.
  • options() (helios/src/server/protocol/decode.rs) lowered body["text"]["format"] into inference::Constraint, discarding json_schema metadata (name, description, strict) and deferring schema type validation until grammar compilation.
  • responses_messages() (helios/src/server/protocol/decode.rs) set is_error: false unconditionally on function_call_output and custom_tool_call_output items.
  • http::no_websocket() (helios/src/server/http.rs) returned HTTP 400 with "WebSockets are not supported; use POST /v1/responses with HTTP/SSE", and docs/api.md did not document that GET response or the Responses echo and is_error contracts.

After:

  • Namespace preservation and tool lowering (helios/src/server/inference.rs, helios/src/server/protocol/decode.rs, helios/src/server/request.rs): inference::Tool stores namespace_description: Option<String> with absent and empty descriptions normalized to None. decode() rejects duplicate Responses namespace names in one request with HTTP 400. Empty "tools": [] namespace wrappers produce zero callable Tool entries and emit no entry in response["tools"]. request::template_inputs() prepends nonempty namespace_description before custom-tool grammar instructions when lowering tools to prompt templates.
  • Responses text.format validation (helios/src/server/protocol/mod.rs, helios/src/server/protocol/decode.rs, helios/src/server/http.rs): Decoded carries text_format: Option<Value> (None when omitted, null, or on non-Responses protocols, avoiding dead allocations on Chat, Completions, and Messages requests). Inside options(), a single-pass responses_text_format() helper returning Result<Option<(Option<Constraint>, Value)>> handles Protocol::Responses, rejecting non-object text or text.format, unsupported format types, missing or invalid json_schema.schema values (requiring a JSON object or boolean, matching helios/src/grammar.rs), and invalid optional name, description, or strict fields with HTTP 400. Mutual exclusion against top-level grammar is checked directly on the returned option. http::generate() calls encoder.set_text_format(decoded.text_format) before encoder.start().
  • Responses tool and format echoing (helios/src/server/protocol/encode.rs): Encoder::new() precomputes responses_tools: Value once via build_responses_tools(&tools) when protocol == Protocol::Responses (and Value::Null otherwise), and Encoder::start() reuses the built response object across response.created and response.in_progress instead of rebuilding it twice. Encoder::response() serializes self.responses_tools and self.text_format (materializing {"type": "text"} in one place when None) across buffered HTTP JSON responses and all Responses SSE lifecycle events (response.created, response.in_progress, response.completed, response.incomplete, and response.failed). A shared responses_tool_entry() serializer emits unqualified tool.name for both standalone and namespaced tools, preserving function parameters (or null when undeclared), strict, optional nonempty description, custom text/Lark/regex format, and first-appearance namespace grouping.
  • Responses tool-output is_error (helios/src/server/protocol/decode.rs): responses_messages() decodes optional boolean is_error via flag(&item, "is_error", false)? for both function_call_output and custom_tool_call_output (absent or null -> false, non-boolean -> HTTP 400), feeding the shared Part::ToolResult lowering used by Chat Completions and Anthropic Messages across Jinja, DeepseekV4, DeepseekV41, and TmlV0.
  • GET /v1/responses and API specification (helios/src/server/http.rs, docs/api.md): http::no_websocket() retains HTTP 400 (invalid_request_error) with "GET /v1/responses and WebSocket transport are not supported; use POST /v1/responses with HTTP JSON or SSE". docs/api.md specifies the GET /v1/responses HTTP 400 behavior, duplicate namespace rejection and empty namespace wrapper omission in response.tools, Responses tools/text.format echoing, and Responses tool-output is_error decoding.

Compatibility and resource lifetimes: No Protobuf schema, model core format, cache layout, scheduler, or CUDA graph contract changes; existing exported cores load and serve unchanged. Non-error tool results and nonempty namespaced tool prompts render identically to before; explicitly empty "description": "" namespace wrappers intentionally stop prepending main's spurious leading "\n" to tool descriptions, and failed Responses tool outputs now render distinct error tokens so prefix caching naturally separates error and non-error trajectories. Per-request host storage for responses_tools, text_format, and namespace_description is bounded by the HTTP body limit (max_body_bytes, 32 MiB default), serialized only on response lifecycle envelopes rather than per token delta, and dropped upon request completion or disconnect.

Claimed benefit and result

  • Observed in CPU contract and HTTP entry-point tests: Buffered and streamed OpenAI Responses payloads echo precomputed standalone, custom, and namespaced tools and validated text.format objects consistently with tool_choice; malformed text/text.format, non-boolean is_error, and duplicate namespace requests fail with HTTP 400 before model admission; Responses function_call_output and custom_tool_call_output items with is_error: true lower identically to Chat Completions and Anthropic Messages across Jinja, DeepseekV4, DeepseekV41, and TmlV0 (including multimodal outputs); and GET /v1/responses returns HTTP 400 with explicit HTTP JSON and SSE guidance matching docs/api.md.
  • Expected but unmeasured against a live server: OpenAI Python SDK v2 Pydantic deserialization of echoed response.tools and response.text from a running Flare process serving an exported core.

Supporting evidence and material limitations

Executed on Linux aarch64 after rebasing onto origin/main (8da73911, which includes #624 fixing the Python CPU CI premises) with external frontend templates prepared via tests/frontend/prepare_templates.py (FLARE_TEST_TEMPLATE_DIR):

  • cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --target-dir flare-cli/target: 1,816 passed, 0 failed, 83 pre-existing #[ignore] skipped (1,754 passed, 46 ignored in src/lib.rs; 62 passed, 37 ignored across 14 integration test binaries and doctests). Six added tests cover the changed contracts:
    • responses_tools_echo_and_round_trip_standalone_custom_and_namespaces (helios/src/server/protocol/tests.rs): decode -> encode -> decode equality of inference::Request and request::template_inputs across standalone function/custom tools, undeclared parameters, strict, text/Lark/regex formats, omitted/empty/nonempty namespace descriptions, nested custom tools, empty namespace wrappers, and duplicate namespace rejection.
    • responses_text_format_validation_echo_and_grammar_exclusion (helios/src/server/protocol/tests.rs): HTTP 400 rejection for non-object text/text.format, invalid json_schema.schema, invalid name/description/strict, and grammar combined with explicit text.format; acceptance of boolean schemas and grammar with omitted or null text.format.
    • responses_tool_outputs_decode_is_error_and_match_chat_and_messages (helios/src/server/protocol/tests.rs) and responses_tool_result_is_error_matches_chat_and_messages_across_prompt_encoders (helios/src/server/protocol/decode.rs, sharing a deduplicated tml_frontend test helper): is_error decoding (true, false, null, omitted, non-boolean rejection) on function_call_output and custom_tool_call_output for text and multimodal (input_text + input_image) payloads, confirming prompt-rendering parity with Chat Completions and Anthropic Messages across Jinja, DeepseekV4, DeepseekV41, and TmlV0 (<|content_tool_error|>).
    • responses_http_generate_echoes_tools_and_text_format_across_lifecycle (helios/src/server/runtime/phase_tests.rs): production http::generate buffered and streamed /v1/responses requests verifying pre-admission HTTP 400 rejection and echoed tools and text.format on buffered responses and response.created, response.in_progress, response.completed, response.incomplete, and response.failed SSE events.
    • get_responses_returns_bad_request_with_http_json_and_sse_guidance (helios/src/server/http.rs): HTTP 400 invalid_request_error envelope and updated guidance text from http::no_websocket.
  • cargo test --locked --release --manifest-path flare/Cargo.toml --target-dir flare-cli/target: 245 passed, 0 failed, 4 pre-existing #[ignore] skipped.
  • cargo test --locked --release --manifest-path flare-cli/Cargo.toml: 227 passed, 0 failed, 3 pre-existing #[ignore] skipped.

Unrun checks and material limitations:

  • Live OpenAI Python SDK v2 tests (FLARE_API_TEST_URL=http://127.0.0.1:8000 .venv/bin/python -m pytest tests/server/test_protocols.py -q) were not run because no native Flare server serving an exported model core on NVIDIA GPU hardware was exercised.
  • Pre-existing #[ignore] Rust tests (83 in helios, 4 in flare, 3 in flare-cli, covering GPU, checkpoint, and live-hardware paths) were skipped by default in CPU release runs.
  • Scheduling simulator (scripts/scheduling_sim/) and formal verification checks (verification/helios-lifecycle/check.py, cargo kani) were not run because no scheduler, cache, lifecycle, completion-vector, or rank-coordination code changed.

Discord: flare-autobot

@flare-autobot

Copy link
Copy Markdown
Collaborator Author

A case file has been opened for 638.
Case File Intake Report

Future reviews will auto-run 90 minutes after code updates are pushed.

  • Re-review sooner: Call @flare-autobot after push.
  • Opt-out: Include #autobot:ignore in the PR or any comment.

@flare-autobot flare-autobot added area:api Serving API, protocol encoding, tool parsing, and client-visible behavior. bug Something isn't working priority:P2 Normal bug priority: workflow failure or diagnosis with narrower impact or an available workaround. triage:review Proposed change needs code review; this does not imply merge readiness. labels Nov 30, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator Author

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

PR #638 cleanly fixes all three #450 defects in Helios's shared HTTP protocol layer with strong CPU test coverage, but should not merge until the unexplained red CI on f414393 is resolved and the per-request 4× responses_tools() reconstruction is eliminated.

  • Blockers: 1 · Should fix: 1 · Subtract/Simplify: 3 · Nits: 2
Walkthrough
  • Namespace preservation & prompt lowering (inference.rs:58-70, decode.rs:903-926, request.rs:517-533): adds namespace_description: Option<String> on Tool (absent/empty → None), rejects duplicate Responses namespace names with HTTP 400, and moves namespace-description prepending into request::template_inputs() ahead of custom-tool grammar instructions.
  • Responses text.format validation (protocol/mod.rs:67, decode.rs:466-503,549-564, http.rs:371): new responses_text_format() validates text, text.format, json_schema.schema (object or boolean), and optional name/description/strict before admission, preserves grammar mutual exclusion, and feeds Decoded.text_format into Encoder::set_text_format() before encoder.start().
  • Responses tools & text.format echoing (encode.rs:23-54,184-193,306-329,818): replaces hardcoded "tools":[] and "text":{"format":{"type":"text"}} in Encoder::response() with self.responses_tools() (standalone function/custom tools + first-appearance namespace grouping) and self.text_format, across buffered responses and all five SSE lifecycle events.
  • Tool-output is_error parity (decode.rs:337-345): decodes optional boolean is_error via flag(&item, "is_error", false)? for function_call_output and custom_tool_call_output, matching Chat Completions and Anthropic Messages across Jinja, DeepseekV4, DeepseekV41, TmlV0.
  • GET /v1/responses message & docs (http.rs:20-25, docs/api.md:231-233,733-738): http::no_websocket() guidance now covers plain HTTP GET /v1/responses and HTTP JSON/SSE; docs cover GET 400 behavior, Responses echo, and is_error decoding.
Merge Risk: Low · up to f414393
  • Scope is strictly Helios's shared HTTP protocol layer (protocol/*, request.rs, http.rs, inference.rs, docs/api.md); no model-core, Protobuf, scheduler, cache-layout, or CUDA-graph impact, and all in-repo Tool/Decoded construction sites are updated.
  • No per-token delta path touched (Encoder::response() runs only on lifecycle envelopes), no shared mutable state or locks added, all new tests isolated with no global-state hazards.
  • Remaining risk is the unexplained red CI on f414393, plus transient CPU/heap amplification on tool-heavy /v1/responses requests from rebuilding and deep-cloning response.tools 4× per request.
Pre-merge checks: ✅ 3 passed · ⚠️ 1 warnings
Blockers (1)
  1. Unexplained CI failure on head f414393: the PR reports 1,805 (helios), 245 (flare), 227 (flare-cli) local passes with 0 failures on f414393, yet CI failed on that same head and the failure is neither mentioned nor explained. Static inspection found no missing Tool/Decoded struct-literal updates across the workspace, so the exact failing job/log must be inspected and fixed (or re-run green) to satisfy the verification gate (docs/design-review.md Principle 12).
Should fix (1)
  1. Eliminate 4× redundant responses_tools() reconstruction and schema deep-cloning per Responses request (encode.rs:294-300,306-329,730,818,827; http.rs:415,534,582):
    • Verified impact: Encoder::response() calls self.responses_tools(), which allocates a HashMap, rebuilds every tool/namespace JSON object, and deep-clones every tool's parameters schema (encode.rs:42-46). In http::generate(), every successful /v1/responses request (streaming and buffered) calls encoder.response() 4 times (3× on post-start failure): twice back-to-back in Encoder::start() (encode.rs:295, :298, though response was already computed on 295), once in Encoder::finish() (:730) or Encoder::failure() (:827), and a fourth at http.rs:582 (Delivery::Complete, discarded by streaming at http.rs:614, while buffered discards the first three at http.rs:640). For coding-agent workloads declaring large JSON-schema tool lists (bounded only by the 32 MiB max_body_bytes), this is avoidable CPU and heap amplification on Tokio worker threads.
    • Fix: since self.tools is immutable after Encoder::new, precompute responses_tools: Value once in Encoder::new when protocol == Protocol::Responses (else Value::Null) instead of calling self.responses_tools() per response(). Also reuse response.clone() in Encoder::start() (encode.rs:295-298) rather than calling self.response() twice.
Subtract / Simplify (3)
  1. Make responses_text_format() truly single-pass and delete the .unwrap() / unreachable!() re-dispatch (decode.rs:466-503,549-564): it already matches field(format, "type")? on "text" | "json_object" | "json_schema", then options() immediately re-matches format["type"].as_str().unwrap() with _ => unreachable!(). Return Result<Option<(Option<Constraint>, Value)>> (or Result<(Option<Constraint>, Option<Value>)>) directly, removing the second match, .unwrap(), unreachable!(), and extra format["schema"].clone() lookup.
  2. Collapse the three json!({"type": "text"}) defaults into one and avoid dead allocations on non-Responses requests (protocol/mod.rs:67, decode.rs:562,584, encode.rs:187,818): json!({"type": "text"}) is built in decode.rs:584 and again in Encoder::new (encode.rs:187) for every Chat, Completions, and Messages request, though self.text_format is read only in the Protocol::Responses arm (encode.rs:818). Store text_format: Option<Value> on Decoded and Encoder (default None) and materialize {"type": "text"} in one place in Encoder::response().
  3. Deduplicate the ~58-line TML frontend fixture in decode.rs tests (:2263-2325 vs :2099-2157): extract a shared fn tml_frontend(include_image_pad: bool) -> Frontend helper next to native/renderer at decode.rs:1096 and call it from both tests.
Nits (2)
  • PR description compatibility wording: in "Compatibility and resource lifetimes", qualify "namespaced tool prompts render identically to before" to note that explicitly empty "description": "" namespace wrappers intentionally stop prepending main's spurious leading "\n" (decode.rs:853-855 on main vs decode.rs:912-916 and request.rs:520-527).
  • docs/api.md namespace rules: consider a brief sentence at docs/api.md:571-572 noting that duplicate Responses namespace names are rejected (HTTP 400) and empty namespace wrappers emit no entry in response.tools.
Dropped on verification (7)
  • "type": "namespace" is a Flare-only wire type, flatten to namespace__name (F2): dropped — NamespaceTool is part of the OpenAI Responses API tool union, and flattening would contradict the namespace field emitted on Responses function_call items (encode.rs:370).
  • Omit "description" on echoed namespace entries and remove .filter(|s| !s.is_empty()) at request.rs:523 (Subtraction flare run fails at "Prepare execution": cuGraphAddKernelNode_v2 CUDA_ERROR_INVALID_VALUE (qwen3.8-flash TP2, RTX PRO 5000 Blackwell 48 GB) #2): dropped — NamespaceTool requires a string description ("" when omitted, covered by protocol/tests.rs:2795-2807), and request.rs:523 is a 1-line defensive guard on a pub field.
  • Echo {"type": "grammar", ...} in response.text.format when top-level grammar is used (F6): dropped — OpenAI's Response.text.format union only allows text | json_object | json_schema; injecting grammar would break SDK deserialization, and {"type": "text"} is intentional (protocol/tests.rs:3183-3195).
  • PR body implies a nonexistent rule change for grammar mutual exclusion (F4): dropped — the sentence accurately describes checking has_format before defaulting absent/null text.format.
  • Framing standard JSON type checks as "seven undocumented HTTP 400s" (F7): dropped as overstated; only the two behavioral namespace rules were kept as a doc nit.
  • Mark inference::Tool as #[non_exhaustive] (F8): dropped — crate is unpublished, all workspace literals were updated, and Tool has evolved this way in prior PRs (e.g. Add strict function-tool schemas for DSML, Qwen, GLM and TML parsers #418).
  • Test style suggestions at phase_tests.rs:4747-4755 and http.rs:714-721 (Subtraction Window cancel e2e test false-fails when generation wins the race #5 & Add an embeddable Rust SDK for in-process Flare inference #6): dropped as low-signal preferences; the exact-string assertion matches the neighboring test at http.rs:658-660.

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

Clients using Helios's OpenAI Responses endpoint (`POST /v1/responses`) inspect
the returned response object's `tools` and `text.format` fields to confirm
active declarations and structured-output constraints across buffered JSON and
SSE lifecycle events, and pass `is_error: true` on `function_call_output` and
`custom_tool_call_output` items to signal failed tool executions to the model.
Previously, Helios hardcoded empty `tools` and default `text.format` on every
Responses payload, dropped `is_error` on Responses tool outputs, and returned a
WebSocket-only message on `GET /v1/responses`. Carrying normalized namespace
metadata on `inference::Tool`, validating and retaining the Responses
`text.format` object during protocol decoding, and feeding Responses tool-output
`is_error` into the shared `Part::ToolResult` representation keeps all protocol
handling in Helios's shared HTTP layer without touching model contracts,
scheduling, or GPU execution paths.

Before this change:
- `Encoder::response()` in `helios/src/server/protocol/encode.rs` hardcoded
  `"tools": []` and `"text": {"format": {"type": "text"}}` for
  `Protocol::Responses`.
- `decode()` in `helios/src/server/protocol/decode.rs` concatenated each
  Responses tool namespace's `description` directly into `Tool.description`
  (preventing lossless namespace echoing and adding a leading newline when a
  namespace description was empty) and accepted duplicate namespace names in
  one request.
- `responses_messages()` in `helios/src/server/protocol/decode.rs` hardcoded
  `is_error: false` on `function_call_output` and `custom_tool_call_output`
  items.
- `http::no_websocket()` in `helios/src/server/http.rs` returned HTTP 400 with
  `"WebSockets are not supported; use POST /v1/responses with HTTP/SSE"`, and
  `docs/api.md` did not state the `GET /v1/responses` status or the Responses
  echo and `is_error` behavior.

After this change:
- `inference::Tool` (`helios/src/server/inference.rs`) stores an optional
  normalized `namespace_description` (`None` when absent or empty). `decode()`
  rejects duplicate Responses namespace names with HTTP 400, and
  `request::template_inputs()` (`helios/src/server/request.rs`) prepends
  nonempty namespace descriptions before custom-tool grammar instructions when
  lowering tools to prompt templates (stopping the spurious leading `"\n"` for
  explicitly empty `"description": ""` namespace wrappers).
- `decode()` parses Responses `text` and `text.format` in a single pass through
  `responses_text_format()` returning `Result<Option<(Option<Constraint>, Value)>>`,
  rejecting non-object `text` or `text.format`, unsupported format types,
  invalid `json_schema` `schema` values (requiring a JSON object or boolean,
  matching `helios/src/grammar.rs`), and non-string or non-boolean optional
  `name`, `description`, and `strict` fields with HTTP 400. Mutual exclusion
  with top-level `grammar` is checked before keeping `Decoded.text_format` as
  `Option<Value>` (`None` when absent, `null`, or non-Responses, avoiding dead
  allocations on Chat, Completions, and Messages requests). `http::generate()`
  (`helios/src/server/http.rs`) passes `decoded.text_format` into
  `Encoder::set_text_format()` before `encoder.start()`.
- `Encoder::new()` precomputes `responses_tools: Value` once via
  `build_responses_tools(&tools)` when `protocol == Protocol::Responses`
  (echoing standalone function and custom tools with unqualified `name`,
  nullable `parameters` when undeclared, `strict`, and text/Lark/regex custom
  formats, and grouping namespaced tools under their namespace wrapper), and
  `Encoder::start()` reuses the built response object across `response.created`
  and `response.in_progress`. `Encoder::response()` serializes `responses_tools`
  and `text_format` (materializing `{"type":"text"}` only when `None`) across
  buffered JSON responses and all Responses SSE lifecycle events
  (`response.created`, `response.in_progress`, `response.completed`,
  `response.incomplete`, and `response.failed`).
- `responses_messages()` decodes optional boolean `is_error` (defaulting to
  `false` when omitted or `null` and rejecting non-booleans with HTTP 400) on
  `function_call_output` and `custom_tool_call_output` items, reusing the
  shared `Part::ToolResult` lowering used by Chat Completions and Anthropic
  Messages across `Jinja`, `DeepseekV4`, `DeepseekV41`, and `TmlV0` prompt
  encoders.
- `http::no_websocket()` returns HTTP 400 (`invalid_request_error`) with
  `"GET /v1/responses and WebSocket transport are not supported; use POST /v1/responses with HTTP JSON or SSE"`,
  and `docs/api.md` specifies these behaviors including duplicate namespace
  rejection and empty namespace wrapper omission from `response.tools`.

Result: OpenAI Responses buffered responses and SSE lifecycle events echo
declared standalone, custom, and namespaced `tools` (precomputed once per
request) along with validated `text.format` objects; invalid `text.format` and
duplicate namespace requests fail with HTTP 400 before model queue admission;
Responses failed tool outputs lower identically to Chat Completions and
Anthropic Messages across all four prompt encoders; and `GET /v1/responses`
returns HTTP 400 with explicit HTTP JSON and SSE guidance. No Protobuf schema,
model core format, cache layout, scheduler, or CUDA graph contract changes;
existing exported cores load unchanged.

Evidence (Linux aarch64 with external frontend templates prepared via
`tests/frontend/prepare_templates.py`):
- `cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --target-dir flare-cli/target`:
  1,816 passed, 0 failed, 83 ignored (1,754 lib + 62 integration, including
  6 new tests covering tool round-trip and namespace rules, `text.format`
  validation and `grammar` exclusion, `is_error` decoding and four-encoder
  parity via a shared `tml_frontend` helper, `http::generate` buffered/SSE
  lifecycle echoing, and `GET /v1/responses` HTTP 400 guidance).
- `cargo test --locked --release --manifest-path flare/Cargo.toml --target-dir flare-cli/target`:
  245 passed, 0 failed, 4 ignored.
- `cargo test --locked --release --manifest-path flare-cli/Cargo.toml`:
  227 passed, 0 failed, 3 ignored.

Unrun checks and limitations: Live OpenAI Python SDK v2 tests
(`tests/server/test_protocols.py` against a running native Flare server with
an exported GPU model core), pre-existing `#[ignore]` GPU/checkpoint Rust
tests, scheduling simulator, and formal lifecycle/Kani checks were not run.

Signed-off-by: yatesdr <6937857+yatesdr@users.noreply.github.com>
Design-Signed-Off-By: yatesdr; design-review=2e5b
@yatesdr
yatesdr force-pushed the fix/issue-450-responses-echo-and-tool-error branch from f414393 to 7ba8c66 Compare November 30, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:api Serving API, protocol encoding, tool parsing, and client-visible behavior. bug Something isn't working priority:P2 Normal bug priority: workflow failure or diagnosis with narrower impact or an available workaround. triage:review Proposed change needs code review; this does not imply merge readiness.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/v1/responses echo omits the request's tools and always reports text.format: text; tool outputs always decode with is_error: false

2 participants