#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):
- New required trait method
ToolDialect::parse_eos(body, tools) -> Result<Vec<(String,String)>>(tagged.rs:45) — object-safe, no per-model boolean flags (explicitly contrasted with #514's LENIENT_EOS_CLOSE flag approach in the description). TaggedToolsgainsconfirmed: boolandouter_closed: boolfields.finish(Termination::Eos): only ifconfirmed && !in_json_string, else the oldErr("incomplete <NAME> tool call"). Then delegates toD::parse_eos. (tagged.rs ~310-321)confirmedis set true onOutputStart::ToolBodyconstruction (tagged.rs:428) and fromD::starts_callreturningSome(true)when the marker is chosen in Mode discovery (tagged.rs:715-720). Crucially, whenself.finishingis true an undecided opener (starts_call == None) is now_ =>taken as a marker but withconfirmed = decision == Some(true), i.e. false — this is why<tool_call>runat EOS errors rather than fabricating.outer_closedset from the candidate scan: true when D::CLOSE matched, false when D::FUNCTION's closer matched first (tagged.rs:272-283). Used to setouter_tool_pending = D::FUNCTION.is_some() && !outer_closed(tagged.rs:590-596) — i.e. do not expect a trailing</tool_call>if the inner function closer already consumed it.TaggedOutput::finishnow doesself.calls += events.count(ToolBegin)before extending output (tagged.rs:519-528), so recovered calls get correct indices / the call counter advances.emit_callshelper extracted from push into an impl block so finish can reuse it.RawArguments::is_empty()added (tagged.rs:844-847) — used by chatml's parse_candidate condition; a small undeclared-ish helper but implied by the description.
Beyond the description: the description frames this as only a natural-EOS recovery, but two behaviours change outside EOS:
FunctionTags::parse_candidatenow passes allow_unclosed_function=true to parse_tool_candidate, and MiniMaxparse_candidatenow 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.outer_tool_pendingsemantics change for all terminations (not just EOS): previously unconditionallyD::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.self.callsincrements inTaggedOutput::finishaffects 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:
- #514 (open PR, jannerchang, 2026-11-25): same GLM symptom, with the same shape of claim ("GLM-5.3-Flash occasionally emits a complete
<tool_call>name<arg_key>…</arg_key><arg_value>…</arg_value>and then hits EOS without</tool_call>") — also no captured log/frequency. So the GLM half of the problem has an independent, earlier report in the tracker (PR #514), which is the only concrete prior statement of the problem. - #133 (closed issue) explicitly recorded the current behaviour as deliberate and documented: "an open
<tool_call>at natural EOS errors withincomplete GLM tool call, while the same open call atmax_tokensis silently dropped"; and stated the drop-at-limit/error-at-EOS asymmetry "was introduced deliberately in99cfcd5be, pinned by the testoutput_limits_allow_incomplete_tools_but_eos_rejects_themin03074c11, and restated in #67", concluding "Changing stream semantics after a parse failure is a maintainer policy decision that would editdocs/api.md, not a defect fix." That is the exact policy #573 now reverses (and it does edit docs/api.md, as #133 said it would). - #67 (merged) fixed the related but distinct EOS abort (#30) where prose tag mentions killed the response, and explicitly preserved the EOS-rejects-incomplete behaviour ("At finish an undecided opener is still parsed as a call, so a truncated call keeps failing at EOS"); #573 changes only that undecided-opener path's
confirmedflag, which #67 relies on. - #39/#179 were about GLM aborting on type-mismatched arg values (fixed by retaining values), not about missing closing tags.
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):
ToolDialect::parse_eosis a REQUIRED trait method with no default (helios/src/output/tagged.rs:43-45). All five in-crate impls were updated (argument_tags.rs:109, chatml.rs:30, gemma_call.rs:147, minimax_xml.rs:203, pipeline.rs:49).git grepshows exactly those five impls ofToolDialect(argument_tags.rs ArgumentTags, chatml.rs FunctionTags<WRAPPING_NEWLINES>, gemma_call.rs GemmaCall, minimax_xml.rs MiniMaxXml, pipeline.rs PlainText), so the trait surface is closed in-tree. DeepSeek DSML/XTML/recipient/TML have their own parsers, not ToolDialect.- Anti-fabrication gate, verified:
TaggedTools::finishreturns the same oldErr("incomplete {} tool call")when!self.confirmed || self.in_json_string(tagged.rs:313-319).confirmedcomes from the Mode-discovery decision at tagged.rs:715-722:Some(true)fromstarts_call→ confirmed;Nonewhileself.finishing→ marker taken butconfirmed = decision == Some(true)= false. AndOutputStart::ToolBody→confirmed: true(tagged.rs:431). So<tool_call>runat EOS errors. The GLMstarts_callreturnsNonefor anything that is a proper prefix of<arg_key>/</tool_call>after the name (argument_tags.rs:112-137), so<tool_call>run<argand<tool_call>run</toolalso stay undecided → error. Tests assert exactly these three prefixes (argument_tags.rs:505-548). outer_closed: set from the candidate scan (tagged.rs:274-293); true only whenD::CLOSEmatched, false whenD::FUNCTION's closer matched first. Consumed at tagged.rs:593-596 to setouter_tool_pending = D::FUNCTION.is_some() && !outer_closed. This is a change on the ordinary streaming path (not only at EOS): previously the flag was unconditionally true after any parsed call for dialects with an inner function closer (Qwen/MiMo/MiniMax). Consequences a reader should know: a following</tool_call>/<invoke…>tail is now consumed inouter_tool_pendinghandling rather than trimming/consuming as before, and the recovered-call case does not leave a dangling expectation. Tests cover the case (chatml.rs case…</parameter></function>\n<tool_call>…, minimax case with{INVOKE_END}then a second{INVOKE}).self.callsincrement moved intoTaggedOutput::finish's Tool mode (tagged.rs:519-528) mirroring the increment already done inparse/parse(tagged.rs:579-583). This is what gives a recovered call index 0 (or n) in the accumulator; before this, a ToolBegin emitted during finish would not advance the counter.emit_callsextracted to impl (tagged.rs:224-246) so push/finish share it.- Per-dialect accept rules as implemented (not just as documented):
- GLM/ArgumentTags parse_body(eos=true) (argument_tags.rs:25-94): rejects empty name (pre-existing), rejects a name containing
<,>or whitespace, rejects declaredstrict: truetools, rejects when the remaining body after the name is empty/whitespace (i.e. bare name, no arg pair), then the ordinary loop requires<arg_key>…</arg_key>and</arg_value>and rejects trailing non-whitespace implicitly because the loop'sstrip_prefix("<arg_key>")fails on trailing text → "GLM tool call requires an argument key". Sotrailingtext errors, and the arg-pair minimum is enforced by the loop, not by an explicit "at least one pair" check. - FunctionTags (chatml.rs:95-178):
allow_unclosed_function && !strict && !arguments.is_empty() && rest.is_empty()breaks (chatml.rs:127-129). Becauseparse_candidatenow passestrue(chatml.rs:28), this also fires mid-stream when</tool_call>closes the call — that is the "also accepted when closed by</tool_call>" case. Bare header, unclosed value, duplicate key, trailing text,strict: trueall still error (the last viaparse_tool_candidatehittingparameter_start→ "tool function requires parameter or closing tag"). - GemmaCall parse_body(eos=true) (gemma_call.rs:109-136): only additional check is
strict→ error. Balance, no trailing text and<|"|>closure are enforced by the pre-existing brace parser (value()errors on unterminated string,!rest.trim().is_empty()errors on trailing). Explicit{}accepted. - MiniMaxXml parse_body(allow_unclosed_invoke=true) (minimax_xml.rs:144-188): when
</invoke>is absent and tool non-strict, takes the rest as parameters and requires ≥1 parsed element and no leftover non-whitespace. Also a new tail checkif allow_unclosed_invoke && calls.is_empty() { Err("XML tool call requires an invoke tag") }. Becauseparse_candidatealso passestrue(minimax_xml.rs:200-202), the</tool_call>-closes-the-invoke case is accepted mid-stream too.
- GLM/ArgumentTags parse_body(eos=true) (argument_tags.rs:25-94): rejects empty name (pre-existing), rejects a name containing
- Non-EOS terminations: guarded earlier in
TaggedTools::finish(tagged.rs:302-312) — Cancelled, ExecutionError, UserStop, OutputLimit clear the buffer and return empty, so nothing is recovered. Unchanged from main. - PlainText::parse_eos returns the existing "tool parsing is not configured" error (pipeline.rs:49-51) so a configured-nowhere parser behaves as before.
Behaviour the description does not spell out:
FunctionTags::parse_candidateandMiniMaxXml::parse_candidatereceive 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.outer_tool_pendingnow depends on which closer ended the call for every tagged call, on the normal path.self.callsaccounting changes at finish.- 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:
- "Covers new unit tests across ArgumentTags, FunctionTags (ChatMlOutput and CompactChatMlOutput), GemmaCall, MiniMaxXml, and OutputPipeline testing every UTF-8 split boundary, typed/nested/empty/mismatched arguments, multi-call indexing, implicit reasoning termination, token-gated reasoning delimiters, OutputStart::ToolBody, bare headers, undecided prefixes (
<tool_call>run,<tool_call>run<arg,<tool_call>run</tool), unclosed keys/values/elements/braces, trailing partial tags,strict: truerejection, and OutputLimit/UserStop/Cancelled/ExecutionError omission." Verified in the diff: argument_tags.rs adds two tests (unclosed_eos_calls_recover_complete_arguments_across_every_utf8_split,unclosed_eos_calls_reject_incomplete_truncated_strict_and_undecided_inputs) covering every char split of six accept cases and 16 reject cases, ToolBody, mixed strict/non-strict, and all four non-EOS causes. chatml.rs adds two (accept across every split incl. compact dialect wrapping newlines; reject partial/strict/non-EOS). gemma_call.rs adds one (accept across every split incl.{}and:lookup{…}; reject 7 shapes; strict; non-EOS). minimax_xml.rs adds one (accept incl.</tool_call>close and two-invoke; reject 8 shapes; strict; non-EOS). pipeline.rs addstoken_gated_reasoning_delimiters_preserve_unclosed_eos_tool_calls. server/protocol/tests.rs addsunclosed_tagged_tool_calls_at_eos_match_protocol_and_control_semantics(5 dialects × 3 protocols × cases 1, 1b, 2, 3, 4, 5, 6) and extendsstrict_tool_wires_reach_encoder_only_after_parser_completionwith the unclosed-strict-at-EOS assertion for Qwen and GLM only. server/logprobs.rs addsunclosed_glm_tool_call_at_eos_preserves_content_logprobs_and_reasoning_tokens(worker × streaming = 4 combinations, Responses).
Claims not verifiable from the diff / gaps:
- "203 passed, 0 failed, 4 ignored" — plausible from the added test count but not re-run here; no CI log is quoted and there is no per-suite breakdown of which binary produced the number. The stated command filters
output:: server::protocol::tests:: server::logprobs:: server::output:: grammar::, which cannot include a test namedserver::logprobs::tests::unclosed_glm_tool_call_at_eos_preserves_content_logprobs_and_reasoning_tokens? It can (prefixserver::logprobs::). Fine. - "across all 5 tagged dialect configurations (
glm,qwen,mimo,gemma,minimax)":qwenandmimoare the sameToolParserKind::QwenCoder, differing only inwrapping_newlines(1 vs 0). So it is 4 parser kinds, 5 configurations. Described as "configurations", which is accurate, but a reader may over-read it as five independent dialects. strict_tool_wires_reach_encoder_only_after_parser_completionextension covers onlyQwenCoderandGlmArgumentTags(the match has_ => None), not Gemma/MiniMax — consistent, because strict tools are rejected at admission for MiniMaxXml/GemmaCall (#418: "return HTTP 400 … when an active strict tool targets an unsupported parser (Xtml, MiniMaxXml, GemmaCall, Atem)"). Good: thestrict: truerejection paths in gemma_call.rs and minimax_xml.rsparse_eosare therefore only reachable from hand-built configs, not from the HTTP API. Worth noting so nobody reads them as user-facing.- No captured model output, no served/live request, no frequency measurement for the underlying model behaviour, and no GPU/serving run at all. The description says so under "Unrun checks": checkpoint-gated tests and "live GPU serving runs were not executed; verification is at the output parser, decoder/logprobs, and protocol encoder layers."
- The claim "Undecided openers, bare headers … continue to fail or omit without fabricating calls" is backed by tests and by reading
confirmed. - The claim about
tool_choice(auto,required,named), undeclared tools,parallel_tool_calls: falseis backed by protocol tests cases 1b/2/3/4 — but only exercising encoder-side behaviour with hand-fed text, no HTTP.
#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:
- 0b09434d 2026-11-22 Joshua Cartu — "Constrain strict function-tool arguments in native tool syntax (#418)"
- 9d1e0137 2026-11-11 Mark Yong — "Retain GLM tool arguments that do not match their declared type (#179)"
- f76b517f 2026-11-11 Martin Vit — "Allow XTML message closure after structured answers (#228)"
- 902c88e2 2026-11-02 yatesdr — reasoning-token budget (#167)
- 5dd6723e 2026-11-02 Brandon M. Music — #162
- 28f0833b / 5ed3f47f / c845f6e9 2026-10-27 Luke Alonso — recipient-header work
- de6f53e9 2026-10-27 Mark Yong — #94
- a5b6ed26 2026-10-26 Mark Yong — "Keep prose tool-tag mentions in function-tag and GLM output as text (#67)"
- 13dfa454 2026-10-22 Luke Alonso — MiniMax M3.1 Flash
- 03074c11 2026-10-15 Luke Alonso — Kimi K3 (the commit #133 says pinned
output_limits_allow_incomplete_tools_but_eos_rejects_them) - 99cfcd5b 2026-10-13 Luke Alonso — "Add native LLM API protocols and reject zero temperature" (the commit #133 says introduced the drop-at-limit/error-at-EOS asymmetry) So the author of this PR is the original author of both the EOS-error behaviour (99cfcd5b) and the pinned test (03074c11), and of the last several structural changes in this file. Reachable conclusion for the report: #573 reverses a rule the same author introduced, which is a strong signal it is an intentional policy revision rather than a regression fix — and it means the reviewer question is not "is this a bug" but "is this the right time and shape".
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:
- Mark Yong (@mark-yong, CONTRIBUTOR): #67 (prose mentions, added
starts_calland the "undecided opener at finish is still parsed as a call" rule — #573 flips its EOS outcome), #179 (GLM arg retention), #102 (ignore_eos finish reason; its own review disclosed the same drop-at-limit behaviour), #94, #162. - Joshua Cartu (@jcartu, CONTRIBUTOR): #418 merged 2026-11-22, huge strict-tool PR, touched argument_tags.rs / chatml.rs / tagged.rs / protocol/tests.rs — the most recent large change to these files and the source of the
strict: truesemantics #573'sparse_eosimplementations now branch on (f["strict"].as_bool() == Some(true)). - yatesdr: #405 (declared markers as controls), #167, grammar/strict tests that call
assert_unfinished_at_eos— includingassert_unfinished_at_eos(&out_cfg, "Avoid <tool_call>weather<arg…")and GLM<tool_call>weather</tool_call>-prefix cases in helios/src/grammar/strict.rs:3665-3692. Those asserts are about prose prefixes, not complete argument bodies, so they should still pass (the tested strings carry no</arg_value>/</parameter>), but they sit on the boundary of the changed behaviour and are the tests most likely to be cited either way. - original-el8: triage/closure voice on #32, #133, #179, #102; asked for explicit maintainer acceptance of behaviour changes in #102's review ("These follow from treating ignored EOS as non-terminating. Requesting explicit maintainer acceptance or rejection of these semantics.") — the same review discipline applies here.
- voipmonitor: #228 XTML.
- jannerchang: author of the competing #514.
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:
- Five tagged tool dialects: GLM (
ArgumentTags), Qwen 3.8 / dense Qwen / Nemotron-H / Step 5 (wrappedFunctionTags) and MiMo V2 (compactFunctionTags), Gemma 4 (GemmaCall), MiniMax M3.1 (MiniMaxXml). The recipe-to-dialect mapping is per #67's "Scope across recipes" note: the function-tag rule applies to every recipe using the Qwen3-Coder format (Qwen 3.8, Qwen 3.8 dense, Nemotron-H, Step 5 wrapped, MiMo V2 compact); the GLM rule to GLM 5.3. - Not affected: DeepSeek DSML/XTML (own state machines, still error at EOS — dsml.rs:379-381, xtml.rs:594), TMLv0/ATEM/recipient parsers (own modules,
RecipientOutput::finishuntouched; recipient.rs:547 still pins EOS = error). - No package re-export needed: no contract, protobuf (
helios/proto/runtime_core.protountouched), recipe, or GPU code changes — this is runtime-only, so existing prepared cores pick it up with a new Flare binary. Same conclusion #67 reached for its runtime-only change. - Defaults and configuration: none change. There is no new flag, setting, env var, or per-model boolean (explicitly contrasted with #514's
LENIENT_EOS_CLOSE). So a deployment cannot turn this off — the behaviour is unconditional for non-strict tools. Operators who currently rely on the EOS error to detect malformed generations lose that signal for the accepted shapes; the only remaining signal for those is nothing (the call is returned as a normal tool call). - Client-visible effect: a request that previously ended with an SSE error frame / HTTP error at natural completion now completes with
finish_reason: tool_calls(Chat),stop_reason: tool_use(Messages),status: completedwith a function_call item (Responses). For a client that was retrying on the error, this turns a dying agent turn into a successful one — the same blast-radius reduction #32/#39/#67 argued for. Also affects therequired/namedtool_choice paths: previously an unclosed call underrequiredfailed ("required tool choice was not satisfied"); now it can satisfy it. Protocol tests case 1b/2/3 pin that. - Diagnostics/observability: no metrics or log lines added; the "incomplete tool call" error string remains for undecided/unclosed/ strict cases.
- Compatibility surface for the trait:
ToolDialectispubinsidecrate::output::taggedbut the crate is a binary/runtime crate, not a published library (charter: "in-process Rust SDK (#6): main can already serve in-process, but the crates aren't published yet"), so makingparse_eosrequired breaks no external implementor today. If/when the SDK is published it would be a breaking trait change. - Documentation reach: docs/api.md §"Model output parsers" (444-451) and §tagged dialects (507-525) are rewritten/extended; docs/TODO.txt untouched (nothing added, nothing removed). No other docs mention this behaviour.
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:
- #514 (open PR, jannerchang) — competing/superseded item; same two files (argument_tags.rs, tagged.rs), same GLM symptom, flag-based design (
LENIENT_EOS_CLOSE), +61/-0, auto-review stopped as "low value or does not align with the project charter". - #133 (closed issue, eduffd) — states the old EOS-error behaviour was deliberate, introduced in
99cfcd5be, pinned by testoutput_limits_allow_incomplete_tools_but_eos_rejects_themin03074c11, restated in #67, and that changing it is a maintainer policy decision that edits docs/api.md. Highest-value context found. - #67 (merged, mark-yong) — introduced
starts_calland the "undecided opener at finish is still parsed as a call" rule; fixes #30. #573 changes that rule's EOS outcome from error to conditional recovery. - #418 (merged, jcartu) — strict-tool admission and wire grammars; supplies the
strictsemantics #573'sparse_eosbranches on; restricts strict tools to Qwen/GLM/DSML/TML, so Gemma/MiniMax strict branches are unreachable over HTTP. - #179 (merged, mark-yong) + #39 (closed issue) — GLM aborts whole stream on type-mismatched args; same blast-radius family, different root cause; fixed by retaining values.
- #102 (merged, mark-yong) — ignore_eos finish reason; disclosed the same drop-at-limit vs error-at-EOS asymmetry; its review (original-el8) set the precedent that such semantics changes need explicit maintainer acceptance written into the description.
- #405 (merged, yatesdr) — declared markers as controls; GLM argument markers listed beside delimiters.
- #578 (open, malventano) — DeepSeek analogue of the same "one malformed but recoverable call kills the response" family (recovers args from raw DSML parameter tags). Adjacent, non-overlapping files; #573 explicitly leaves DeepSeek unrecovered, so the pattern remains open on that path.
- #32 (open issue) — undeclared tool names aborting agent loops; the "return the call instead of failing" policy line #573's undeclared-call recovery follows.
- #94, #162, #167, #170, #228, #333, #49, #59 — same files or parsers, no behavioural overlap. #59 (closed) was an earlier GLM argument-tag fix that lost to #179.
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:
- Vision: "meant for people running local models through OpenAI and Anthropic SDK clients", "heavy tool use" — the PR's target population (agentic tool calling) is squarely in scope.
- "Keep the runtime small and model-agnostic. Helios (the runtime) … shouldn't accumulate per-model branches (#267, #334)." #573 adds one shared trait method (
parse_eos) with per-dialect implementations — the per-dialect code lives in the dialect modules where parsing already lives, and the description makes a point of rejecting per-model boolean flags (#514's approach). On balance this lines up with the rule rather than against it; a reviewer could still ask whether five dialect-specific accept rules is "per-model" surface area. - "Design-Signed-Off not mentioned; "Be explicit and pin everything", "Bring real evidence. … Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)." The charter explicitly warns against swallowing errors. #573 narrows acceptance rather than swallowing, but it does convert a class of errors into successful responses, so a reviewer will want the root-cause framing: the PR argues the root cause is the model's wire output being complete, not the parser. No captured model output is offered to substantiate the frequency of that wire behaviour (see the "why" note).
- "PR descriptions: Expect four parts: why, what changed, claimed result, evidence" — #573 does have all four (Why / What changed / Claimed result / Evidence) plus an "Unrun checks / limitations" section and the
Discord: no username providedline AGENTS.md requires. Wait — AGENTS.md:144-150 requires a Discord line; #573's says "Discord: no username provided", which satisfies the stated rule for when no username is provided. - "What gets merged: PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs." The PR references no maintainer request (#514 was not acknowledged by a maintainer), no roadmap item, and gives no reproduction. Reported as a fact; judgement left to the reader.
- Docs alignment: docs/api.md before this PR said "recognized but incomplete calls at natural completion are errors" (line 446-447 on main) and "A tag still undecided when generation ends is parsed as an incomplete call" (line 508). #573 rewrites both passages. Note the second passage at line 507-508 mentions undecided tags being parsed as incomplete calls — #573 leaves that sentence in place while the new §514-525 paragraph adds the recovery rules; a reader may see a residual tension between "A tag still undecided when generation ends is parsed as an incomplete call" and the new "when a non-strict tagged call omits its closing wrapper tag at natural completion, each dialect accepts it…". Reading the code, the undecided sentence remains true (undecided ⇒
confirmed == false⇒ error), so it is consistent, but it reads contradictory in the doc.
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):
TaggedTools::finishnon-EOS guard: tagged.rs:302-312 clears the buffer forCancelled | ExecutionError | UserStop | OutputLimit.- Undecided gate: tagged.rs:317-319
if !self.confirmed || in_json_string { return Err("incomplete {} tool call") }. in_json_stringonly becomes true after a candidate closer was rejected byparse_candidatereturning None (tagged.rs:289-295), so an unterminated JSON string in the args refuses recovery.- Downstream accumulator still refuses half-open calls:
server/output.rs:128-133finish()errors "incomplete emitted tool call" if any accumulated call never gotToolEnd;server/output.rs:1303-1310same for Responses blocks. Becauseemit_callsalways emits Begin/Arguments/End as a triple, a recovered call can never trip these. Verified by reading.
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):
- helios/src/output/chatml.rs:867-900
terminal_cause_preserves_incomplete_call_errors_and_never_fabricates_callspushes exactly<tool_call><function=lookup>(bare header) → still errors at EOS. - helios/src/grammar/strict.rs:3335-3348 helpers
assert_prose_at_eos/assert_unfinished_at_eos; used at strict.rs:3402, :3536, :3681, :3689 with inputs like"Avoid <tool_call>weather","Avoid <tool_call>weather<arg",Avoid <tool_call>weather</tool_callprefixes, and Qwen"Avoid <tool_call>"variants — none carry a closed argument, soconfirmedstays false orstarts_callisSome(false). - helios/src/output/xtml.rs:576-596
output_limits_allow_incomplete_tools_but_eos_rejects_them— different parser, untouched. - helios/src/output/argument_tags.rs's own description references
malformed_calls_fail_without_coercion(from #39/#179) which is untouched by this diff.
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).