Explore report · NVIDIA/hyperflare-inference #685

Raw Markdown for agents: https://autobot.eidonix.com/p/ede4f21d-e866-4219-97f9-94cf49ef74f2.md

Case file — PR #685 "fix(frontend): stream DeepSeek tool-call arguments"

Author peperunas · base main · head 2f0ed9d3da704143b8437eb40e49fd451bb875e0 (2f0ed9d), branch fix/dsml-tool-call-streaming · 13 files, +662/−72 · open, ready for review, no labels, no CI checks, no reviews, no comments · opened 2026-12-02 18:07, updated 2026-12-02 18:07.

Key findings

  1. A second, universal behaviour change hides behind the streaming fix. Accumulator::finish(cause) and ResponseOutput::finish(cause) now drop an announced-but-unfinished tool call for every termination other than Eos (helios/src/server/output.rs:163-173, new pub(crate) fn drops_unfinished_call(cause) -> bool { cause != Termination::Eos } at output.rs:478-480, and output.rs:1730-1742 for the Messages/Responses block emitter). On main, the same situation returned Err("incomplete emitted tool call"), i.e. a request error. This affects all tool parsers and all three wire protocols, while the streaming win affects DSML only.
  2. It inverts an existing test that asserted the opposite. user_stop_cannot_retract_an_already_emitted_partial_tool_call on main becomes user_stop_omits_an_already_emitted_partial_tool_call (helios/src/server/output.rs:1265-1274), now asserting presentation.finish(Termination::UserStop) succeeds and message().tool_calls is absent. The old test's name ("cannot retract") shows the earlier behaviour was deliberate. The description mentions the new behaviour in one clause but never says it replaces an error with success.
  3. It reverses #364's deliberate "check the size bound before emitting any tool event" property. #364 (voipmonitor, merged 2026-11-19, reviewed by yatesdr) moved the 1 MiB check ahead of the first tool event. #685 publishes fragments then runs check_size on the next append (dsml.rs:191-192), and says so in the docs: "The bound is enforced on the append that crosses it, after the call name and earlier argument fragments were published and are not retracted" (docs/api.md:570-572). Transparent, but it undoes another author's reviewed invariant.
  4. The buffering was documented behaviour, not an undocumented bug. docs/api.md:540-541 on main read: "The model parsers buffer tool envelopes until they are complete, so argument events do not imply incremental generation of an unfinished call." #685 deletes that sentence and replaces it with the per-parser description (docs/api.md:540-555). No issue, roadmap item, or maintainer request asks for streaming tool arguments (see "The why").
  5. No independent evidence. No CI checks on the head commit, no reviews, no comments, and unlike neighbouring PRs (#573, #670) no flare-autobot review has run. Every number is self-reported local/release test output plus one measurement against the author's own deployment.

The change

What it does, in plain terms: the DSML (DeepSeek) parser used to hold a whole tool call privately and hand it to the encoder in one burst when the closing tag arrived. Now the parser announces the call as soon as its name completes and pushes out argument bytes as they accumulate, so the client sees the function name early and function.arguments deltas through the generation.

Verified mechanics (helios/src/output/dsml.rs):

Size: one substantive file (dsml.rs, +315/−18) plus a second substantive change in helios/src/server/output.rs (+33/−19) and encode.rs (+2/−2); helios/src/server/protocol/tests.rs +266/−0 is new tests; docs/api.md +25/−12. The other eight files (argument_tags.rs, chatml.rs, gemma_call.rs (not opened), minimax_xml.rs (not opened), pipeline.rs, xtml.rs, runtime_core/protobuf.rs, server/runtime/phase_tests.rs (not opened)) are mechanical finish() → finish(Termination::X) call-site updates.

What the change does that the description does not say

What the description says that the change does not do

The why

Item Relation
#364 (merged, voipmonitor, reviewed by yatesdr) "Enforce DeepSeek tool call size and retain deeply nested values" Reversed in part. #364 moved the 1 MiB check to before the first tool event; #685 publishes first and documents that the bound trips afterwards (docs/api.md:570-572).
#359 (merged, voipmonitor) retain DeepSeek tool values that are not valid JSON Built on. Source of literal/literal_quoted/literal_escaped and close_literal; publish() explicitly defers while a literal may be rewritten (dsml.rs:49-62).
#418 (merged, jcartu) strict function-tool schemas for DSML, Qwen, GLM, TML Built on / preserved. pending_strict_calls parking in encode.rs:564-621 is untouched; #685 adds tests that strict calls still emit nothing early.
#333 (merged, yatesdr) complete responses after one tool call when parallel calls are disabled Built on. It routes the discarded second call as Termination::Cancelled (encode.rs:666); #685's new "Cancelled drops the announced call" path sits on that.
#577 (open) Chat reasoning aliases + allow literal closing tool tags in argument values Complementary; touches argument_tags/chatml/gemma_call/minimax_xml — the parsers #685 leaves buffering. Rebase overlap is mechanical.
#575 (open) preserve raw JSON tool arguments in TmlOutput Same family of byte-faithfulness concern, other dialect.
#578 (merged) bump deepseek-recipe for aborted DSML parameter openers The pinned dependency whose action stream #685 consumes; no bump needed here.
#670 (merged 2026-12-02, lukealonso) THINK_TAGS + TAGGED_JSON Shares eight files including dsml.rs, docs/api.md, protocol/tests.rs, phase_tests.rs (not opened); landed hours after #685 branched (1fbcc3c).
#418's evidence, which cites an output-limit sweep with "zero leaked partial calls" The guarantee #685's truncation change reinterprets — worth re-reading when judging whether partial calls are supposed to leak.
#102 (merged) ignore_eos finish-reason classification Adjacent finish-reason territory; a reviewer there noted a partial tool call can stay in the message while the reason changes.

Recent activity

People

Community

Project fit

Aligns:

Tensions:

Claims and evidence

Claim Backing
Tool name arrives at header completion; arguments arrive incrementally Code: dsml.rs:145-156, 173-206; new tests in protocol/tests.rs (+266) including a full OutputPipeline → Chat encoder round-trip reassembling >2 pre-close frames.
Fragments concatenate to stored arguments byte for byte publish() cursor (dsml.rs:49-62) plus tests at every UTF-8 split; literal deferral prevents rewrite-after-publish. Verified in code.
Truncated output-limit/stop-string/cancel calls keep fragments, are omitted from buffered body Code output.rs:163-173,478-480,1730-1742, encode.rs:658-677; new Chat/Messages/Responses truncation tests.
Strict tools still emit no frame before schema acceptance encode.rs:564-621 untouched; dsml.rs:147 unchanged. Verified.
1787 passed / 16 failed, six need FLARE_TEST_TEMPLATE_DIR, ten engram tests flaky and failing identically on unmodified main Self-reported; count changed from 1783/18 between packet and live body; no CI run to corroborate; flakiness claim untestable here.
Live: 566 argument frames / 2196 bytes hashing identical to non-streaming, previously 2 frames for 2.2 KB Self-reported, one model (pino/chat, DeepSeek-V4.1-Flash-1017), one request, author's own endpoint; no logs or harness reproduced here.
Tagged dialects still buffer; tagged dialects not exercised live; flare/flare-cli not built Admitted in the description and consistent with the diff (only dsml.rs changes semantics).

No claim in the description is contradicted by the diff; the gap is that the description does not present the truncation change as the reversal it is, nor the #364 bound reversal.

Reach

Process

Open questions / could not find

  1. Is dropping the partial call (instead of erroring) a deliberate product decision or a side effect of making streamed fragments consistent? No issue, comment or review records the intent, and the inverted test name suggests the earlier "cannot retract" rule was considered.
  2. Did anyone want DSML streaming? No demand trail exists; #347's body could not be read (tool refused), so it may list the symptom.
  3. Does any consumer depend on server_error for a truncated tool call (monitoring alerts, client retry logic)? Not documented anywhere found.
  4. Do the wiped content_block_start/output_item.added blocks without content_block_stop/output_item.done violate the documented Messages/Responses event grammar? docs/api.md now says the call "cannot complete", but the streaming grammar isn't spelled out for that case.
  5. Whether the self-reported flaky engram failures are truly pre-existing on main — no CI run corroborates, and the count changed between the two copies of the description.
  6. Whether flare/flare-cli still build against the changed crate-internal signatures — the author did not build them; analysis says they don't reference the changed symbols, but that is inference, not a build.