Explore scratchpad · NVIDIA/hyperflare-inference #573

Raw Markdown for agents: https://autobot.eidonix.com/p/93e8ebaa-5ce3-49f7-8c43-421bd81dd1b6.md

#1 [high] The change: what PR #573 does and its size

PR #573 "helios: tolerate omitted closing tags on complete tagged tool calls at EOS" by lukealonso (COLLABORATOR, priority contributor), open, ready for review, 2026-11-28, head 09cc524, base main, 9 files +1423/-70, no reviews, no comments, CI passed.

Files: docs/api.md (+17/-1), helios/src/output/argument_tags.rs (+280/-10), chatml.rs (+206/-6), gemma_call.rs (+130/-10), minimax_xml.rs (+167/-15), pipeline.rs (+108/-0), tagged.rs (+66/-28), server/logprobs.rs (+101/-0), server/protocol/tests.rs (+348/-0).

Core mechanism (helios/src/output/tagged.rs):

Beyond the description: the description frames this as only a natural-EOS recovery, but two behaviours change outside EOS:

  1. FunctionTags::parse_candidate now passes allow_unclosed_function=true to parse_tool_candidate, and MiniMax parse_candidate now calls parse_body(..., true). parse_candidate runs on </tool_call> matches during normal streaming too — so a Qwen/MiMo call missing </function> but closed by </tool_call> is now accepted at any time, not only at EOS. The description does say "(also accepted when closed by </tool_call>)" for these two dialects, so it is disclosed, but it means the change widens acceptance beyond natural EOS for those two dialects.
  2. outer_tool_pending semantics change for all terminations (not just EOS): previously unconditionally D::FUNCTION.is_some() after closing a call, now false when the inner </function>/</invoke> closer ended the call. This affects how a following </tool_call> is consumed in ordinary streaming for Qwen/MiMo/MiniMax — a behavioural change on the normal path not called out in the description.
  3. self.calls increments in TaggedOutput::finish affects call indexing for any ToolBegin emitted at finish (EOS-recovery only in practice).

Also beyond the description: the MiniMaxXml parse_body signature change also changed strictness of the []/tools lookup: it now finds the function object via tool.get("function") and reads f["strict"], and schema lookup changed from tool["function"].get("parameters") to function.and_then(|tool| tool.get("parameters")) — functionally equal.

Trait method is required (no default) → any out-of-tree/missed impl breaks compile; the only impls in the crate are the 5 dialects + PlainText (search: argument_tags.rs:109, chatml.rs:30, gemma_call.rs:147, minimax_xml.rs:203, pipeline.rs:49). DeepSeek DSML/XTML parsers are separate state machines, not ToolDialect (docs/api.md says so), so unaffected.

#2 [high] Related work: #514 is an open competing PR for the same GLM behaviour, reviewed as low-value

#514 (open, PR) "helios: allow lenient EOS close for GLM argument-tag tool calls", by jannerchang, opened 2026-11-25 11:29, updated 11:45, branch pr/glm-lenient-eos-tool-close, +61/-0 across helios/src/output/argument_tags.rs (+32) and helios/src/output/tagged.rs (+29). No human comments; only two flare-autobot comments.

Its approach: const LENIENT_EOS_CLOSE: bool = false on ToolDialect, set true only for ArgumentTags (GLM); on EOS, call D::parse(&raw, &self.tools) and emit events if valid and non-empty. Its own description states "Other dialects (ChatML/Qwen, etc.) keep LENIENT_EOS_CLOSE = false and retain strict incomplete-call errors." Evidence: 24 passed on main 2771618 for output::argument_tags:: + output::chatml:: tests.

#573 is the superset: same problem statement (GLM omitting </tool_call> after </arg_value>), all 5 tagged dialects, and explicitly rejects the per-model flag design ("no per-model boolean flags"). #573 does not mention #514 anywhere in its description — no cross-reference, no "supersedes". If #573 merges, #514 is fully subsumed and would be closed as redundant. The two touch the same two files (argument_tags.rs, tagged.rs) so they conflict textually.

Important signal: jannerchang's #514 was stopped by flare-autobot auto-review with "Auto-Review halted due to finding: It is low value or does not align with the project charter." (#514 comment 2026-11-25 11:45, Value Proposition Report link). That verdict is about #514's flag-based narrow design, but it is also a signal on how the project views the "lenient EOS close" problem area, and it bears on whether #573's scope expansion is the requested direction. Note that #573's author, lukealonso, is one of the three named priority contributors in the charter.

#3 [high] The why: no linked issue or report, and the old EOS-rejects-incomplete behaviour was deliberate and pinned

The PR description cites no issue or PR number at all — no "Closes #", no references. The motivating problem is stated only generically: "Models using tagged tool-call syntaxes occasionally finish generating a complete, self-delimited argument payload and emit EOS without the final closing wrapper tag", with per-model examples (GLM </tool_call>, Qwen/MiMo </function></tool_call>, Gemma 4 <tool_call|>, MiniMax </invoke></tool_call>). No captured model output, no request log, no frequency figure is offered for any of the five dialects.

Searches for a user-facing issue reporting this exact defect found none: search_items for "unclosed tool call" (issue), "EOS closing tag omitted model" (issue), "incomplete tool call EOS error" (issue), "truncated tool call strict wire closer" returned no matching issue. The nearest reports are adjacent, not this:

How long wanted: the earliest tracker statement of the GLM case is #514 on 2026-11-25, three days before #573 was opened (2026-11-28). #573 was opened the same day as head commit 09cc524.

#5 [high] The change: verified mechanism and what the description under-states (outer_tool_pending, parse_candidate leniency, calls counter)

Verified by reading the diff and the resulting files (pr_diff, read_file at PR head 09cc524):

Behaviour the description does not spell out:

  1. FunctionTags::parse_candidate and MiniMaxXml::parse_candidate receive the lenient flag unconditionally, so leniency applies whenever </tool_call> closes the call, at any time — including for a call that completes before generation ends. Disclosed parenthetically in the description ("also accepted when closed by </tool_call>") and in docs/api.md, but it is not an EOS-only change for those two dialects.
  2. outer_tool_pending now depends on which closer ended the call for every tagged call, on the normal path.
  3. self.calls accounting changes at finish.
  4. The Gemma error message reads "incomplete strict Gemma call tool call" (gemma_call.rs:128) — a doubled word in a user-facing error string.

Verified NOT changed: no change to docs/TODO.txt; no change to package format, contracts, protobuf, recipes, GPU code; no change to strict-tool wire grammars (helios/src/grammar/strict.rs untouched). DeepSeek DSML (dsml.rs:379-381 still errors at EOS) and XTML (xtml.rs:577-595 test still pins finish(Eos) = error) are unchanged — so #573 leaves the same class of omission unrecovered for DeepSeek, which is consistent with the description's "both DSML tool syntaxes use their own parsers".

#6 [high] Claims and evidence: tests genuinely added vs unverifiable claims

Claims in the description vs what backs them (all checked by reading the diff; no commands were run in this case file).

Claimed and backed by in-repo tests that the diff actually adds:

Claims not verifiable from the diff / gaps:

#7 [high] People: the PR author wrote the EOS-rejects-incomplete rule this PR reverses; who else owns this code

Commits touching helios/src/output/tagged.rs (search_history, newest first), i.e. who works in this file:

Line counts in the area (orientation packet): helios/src last 180 days — Luke Alonso 214, Martin Vit 51, yatesdr 47. docs — Luke Alonso 373, Martin Vit 55, yatesdr 47.

Other named people in this exact code path and their related work:

Who has engaged on #573 so far: nobody. pr_comments returns "No comments" — no reviews, no auto-review comment (unlike #514, which got a flare-autobot case file and a "Review Stopped: low value / does not align with the project charter" verdict within 16 minutes). No labels on #573 either.

#9 [high] Reach: five tagged dialects and ~9 recipes, runtime-only, no opt-out, and how it meets #418 strict admission

Who/what it affects, verified from the code and docs:

Interaction with #418 (merged 2026-11-22, strict tools): strict: true tools are only admitted for Chat/Responses function tools on DSML, QwenCoder, GlmArgumentTags, TmlJson; MiniMaxXml/GemmaCall/Xtml/Atem strict requests get HTTP 400. So for Gemma and MiniMax the new strict-rejection branches in parse_eos are unreachable via HTTP and are defensive only. For Qwen and GLM the strict gate is real and is exercised at the protocol layer (unclosed strict call at EOS must still error — asserted in the extended strict_tool_wires_reach_encoder_only_after_parser_completion). This is the one genuine cross-cutting constraint: #418's admission rules and #573's leniency must agree, and they do by construction (leniency keyed off the declared tool's strict flag, and undeclared tools are treated as non-strict, so an undeclared name is always recoverable — which protocol test case 3 relies on).

#11 [high] Related work and recent activity: full lead trail with verdicts

Trail followed from the orientation packet, with relevance verdicts. (This was meant to be saved earlier; recording now because the final report needs it.)

Followed and relevant:

Not relevant: #548, #560, #562, #552, #554 (metrics/engram/draft PRs sharing only docs/api.md or protocol/tests.rs), #387/#385 (video/GIF input), #193 (logits corruption), #426, #129, #550, #569, #568, #561, #566, #507, #509, #510, #543, #545, #546, #570, #579 — other subsystems; none touches helios/src/output.

Recent activity: packet says no default-branch commits since the fork point (7cd83f3) touch this PR's files; search_history confirms (newest tagged.rs entry is the PR's own 09cc5244), so no rebase/conflict exposure. helios/src had heavy churn on 2026-11-28 (#579, #570, #569, #568, #561, #566, #550) but all outside helios/src/output. The last change in the output-parser area before this PR is #418 (2026-11-22, five days earlier); #573 depends on post-#418 code.

#4 [medium] Project fit: charter lines on per-model branches, error-swallowing and evidence

Charter (read via read_charter) points that bear on this PR:

Also note: docs/api.md:546-547 "Missing and incomplete calls fail as in required mode" (tool_choice section) was NOT updated by this PR.

#8 [medium] Community and process: zero comments/reviews, CI green, ready-for-review, description shape compliant

Community: none. pr_comments on #573 returns "No comments" — zero reviews, zero inline comments, zero reactions, no labels, opened and last updated 2026-11-28 (same day). Orientation packet confirms "Reviews: none yet" and "Labels: none". Contrast: the competing #514 got a flare-autobot case file 11 minutes after opening and an auto-review "Review Stopped / low value or does not align with the project charter" verdict 16 minutes after opening; #573 has had no bot response recorded in the local copy. Note that #514's auto-review verdict is about #514's narrow flag design and should not be read as a verdict on #573, but it is the only machine-generated signal about the problem area and a reader will want to know it exists.

Process/state: open, "ready for review" per the orientation packet (not a draft), CI on head 09cc524 passed. 9 files, +1423/−70. Age: opened today, so no staleness signal. Description follows the repo's required four-part shape (why / what changed / claimed result / evidence) plus an explicit "Unrun checks / limitations" section and the required Discord: line ("no username provided"). No Signed-off-by/DCO trailer is visible in the PR record, and no Design-Signed-Off-By (docs/design-review.md:298, :314 ask for one), though those live in commit messages which the local record does not show. No design-review digest is quoted in the description, unlike #418 and #179, which both carry Design-Signed-Off-By: … design-review=<hex>. Priority-contributor status: the charter names @lukealonso among the three priority contributors ("carry extra weight—we never close their PRs out of hand"), and CONTRIBUTING.md requires sign-off, so process review will likely be quick.

#10 [medium] Verified detail: remaining guards, pre-existing EOS-policy tests, and error strings

Concrete, citable state of the code around this change (read at PR head 09cc524 unless noted).

Guards that stay in place (the "anti-fabrication" story):

Pre-existing EOS tests that #573 must not break (they all still pass by construction because their inputs are undecided or prose prefixes, not complete bodies):

Error strings a user may see after this PR (unchanged spellings, for grepping): "incomplete GLM tool call" (argument_tags.rs:37, :49, :110), "incomplete strict GLM tool call" (:46), "incomplete GLM argument value" (:86 pre-existing), "GLM tool call requires an argument key" (:60), "tool function requires parameter or closing tag" (chatml.rs:131), "incomplete JSON parameter" (chatml.rs:92), "incomplete strict Gemma call tool call" (gemma_call.rs:128 — doubled word), "unterminated XML invocation" (minimax_xml.rs:171, :179), "XML tool call requires an invoke tag" (minimax_xml.rs:154, :185), "incomplete function-tag tool call"/"incomplete Gemma call tool call"/"incomplete namespace XML tool call" (tagged.rs:318 via D::NAME).

Test-placement note: every new test is inside the parser modules or server/protocol/tests.rs, so they run under --lib. helios/tests/* integration targets were compiled but, per the description, the checkpoint-gated ones (reasoning_delimiters, glm_frontend, parser_start, 15 tests total) were not executed; only deepseek_output ran (14 passed). That is the standard environment limit in this repo (see #102, #179, #418 descriptions for the same FLARE_TEST gates).