Re review report · NVIDIA/hyperflare-inference #685

Raw Markdown for agents: https://autobot.eidonix.com/p/1b81295c-f467-443c-9934-4964745e91e8.md

Recommendation: Changes Requested

Commit 826a427 resolves every technical, protocol, documentation, and test-churn issue from Round 3: truncated Responses custom tool calls now close cleanly as incomplete with empty input instead of failing the request, abandoned function calls report status: "incomplete" across all non-EOS causes, docs/api.md accurately documents tool_choice: required/named failures and TAGGED_JSON-compatible tagged-parser behavior, and restoring Accumulator::finish(&self) shrank the diff from 15 files to 7. Direct verification found zero remaining code bugs or hot-path defects. The sole remaining blocker is the unresolved Round 3 governance gate (AGENTS.md:182-187, 201-207): the PR reverses #364's pre-publication 1 MiB / validation bound and main's non-EOS Err("incomplete emitted tool call") contract (along with their pinning tests and docs), and while the PR description now transparently asks @voipmonitor and @yatesdr to approve both changes, no maintainer decision is recorded on the PR yet. Once a maintainer signs off on both contract changes in the thread, no further code changes are required to merge.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

  1. Explicit maintainer sign-off still required for the two contract reversals and their accompanying test/doc rewrites (AGENTS.md:182-187, 201-207; helios/src/output/dsml.rs:151-155, 191-205; helios/src/server/output.rs:479-481, 1269-1278, 1735-1748; helios/tests/deepseek_output.rs:515; docs/api.md:547-555, 574-576).
    • Verified behavior & impact: Both reversals remain active on 826a427 and still have zero human maintainer comments or approvals in the PR thread:
      1. #364's pre-publication 1 MiB and key-validation guarantee (docs/api.md:600 on main, explicitly verified in @yatesdr's #364 review and pinned by assert!(published.is_empty()) at helios/tests/deepseek_output.rs:511 on main) is reversed so ToolBegin and early ToolArguments fragments publish before validate_arguments and before a subsequent append crosses 1 MiB, with deepseek_output.rs:515 weakened to assert_eq!(parsed.ended, 0, ...).
      2. main's non-EOS Err("incomplete emitted tool call") guarantee (helios/src/server/output.rs:165, 1728 and user_stop_cannot_retract_an_already_emitted_partial_tool_call) is replaced by silent omission via drops_unfinished_call(cause) = cause != Termination::Eos (output.rs:479-481), renaming and inverting that regression test at output.rs:1269-1278.
    • Under AGENTS.md:182-187, 201-207, relaxing existing error/validation guarantees — including via accompanying test and doc updates — requires an explicit maintainer design decision on record before merging.
    • Fix: Obtain an explicit maintainer comment on this PR from @voipmonitor / @yatesdr (or a repository maintainer) approving (a) post-publication validation and 1 MiB enforcement for streamed DSML calls and (b) non-EOS unfinished-call omission (vs restricting omission to OutputLimit or keeping the error). If approved as-is, no further code changes are needed.

Should Fix

None.

Subtract / Simplify

  1. Have Call::publish own self.check_size()? (helios/src/output/dsml.rs:53-62, 191-192, 201-203): Changing Call::publish to return Result<()> and call self.check_size()? before emitting makes the check-before-publish ordering structural in one place instead of repeating the two-line pair at :191-192 and :201-203 (keeping :218-220 for non-publishing actions like ToolName and LabelToolCallArguments).
  2. Simplify the custom match in Encoder::change and self.open check in ResponseOutput::finish (helios/src/server/protocol/encode.rs:471-478; helios/src/server/output.rs:1737-1745):
    • In encode.rs:471-478, matching &self.outputs[0].blocks[i] once avoids matching Block::Tool twice to compute custom and then extract arguments.
    • In output.rs:1737-1741, if drops_unfinished_call(cause) && let Some(last) = self.open && matches!(self.blocks[last], Block::Tool { ended: false, .. }) uses self.open directly instead of re-deriving self.blocks.len() - 1 via self.blocks.last().
  3. Disambiguate the remaining duplicate test name (helios/src/output/dsml.rs:956 vs helios/src/server/protocol/tests.rs:3960): a_truncated_second_call_keeps_the_completed_first_call still exists verbatim in both files; prefixing the parser-layer test (e.g., dsml_truncated_second_call_keeps_the_completed_first_call) keeps cargo test <name> unambiguous.

Nits

Dropped on verification