Verdict: worth merging with changes (#573, helios: tolerate omitted closing tags on complete tagged tool calls at EOS)
What the PR actually is
9 files, +1423/−69, but the production core is only ~150–190 net lines; ~900 lines are tests and 17 are docs. helios/src/output/tagged.rs adds a required ToolDialect::parse_eos (tagged.rs:43-45), tracks confirmed (set only when D::starts_call returned Some(true), or on OutputStart::ToolBody; tagged.rs:715-724, 428-433) and outer_closed, and on Termination::Eos delegates the leftover body to the dialect instead of returning Err("incomplete … tool call") (tagged.rs:302-322). Each dialect then enforces its own structural completeness: ArgumentTags (≥1 closed <arg_key>/<arg_value> pair, valid function name, non-empty body), FunctionTags (≥1 closed <parameter=…>), GemmaCall (brace-balanced, no trailing text), MiniMaxXml (≥1 closed parameter element, no unclosed elements), plus strict: true rejection in all four.
Why it is worth doing (charter fit)
- It is the vision's core workload. The charter's first line is "long conversations, coding agents, and heavy tool use," for "people running local models through OpenAI and Anthropic SDK clients." Today a structurally complete GLM/Qwen/Gemma/MiniMax call that omits only its wire closer fails the whole request at natural EOS. Turning a hard failure into the call the model obviously meant is a real user-facing improvement on the primary path, not a hypothetical one.
- There is measured precedent for exactly this leniency. #67 (merged, same maintainer) measured Qwen3.8 Flash ending its turn where a literal
</tool_call>would follow — 7 of 20 logprob requests, with<|im_end|>at ~0.97 probability versus</tool_call>at ~0.02 — and already accepts prose-complete calls. #228 (merged) accepts omitted XTML message closure the same way. #573 extends an established behaviour rather than inventing one; vLLM/SGLang are likewise more tolerant here. - It is in the right layer and flag-free. The charter mandates "no per-model special cases or flags" and "smallest footprint in shared code." The dialect method puts dialect knowledge in the dialect impls and adds zero branches to the runtime. This is strictly better than #514's
const LENIENT_EOS_CLOSE: bool = trueon GLM only. - The anti-fabrication guardrails survive. I verified them: an undecided opener (
<tool_call>run,run<arg,run</tool) still promotes toMode::Toolduring finish but carriesconfirmed = falseand is rejected;in_json_stringalso rejects; every non-Eoscause still returns empty (tagged.rs:302-312), soOutputLimit,UserStop,Cancelled,ExecutionErrorkeep omitting unclosed calls. All five existingToolDialectimpls were updated, so the new required method breaks no third implementation. - Two incidental fixes came along.
outer_tool_pendingwas previously set even whenD::CLOSEhad already been consumed, which silently swallowed a following duplicate</tool_call>(tagged.rs:593-596 vs 615-635) — a genuine small defect. Theself.callsincrement inTaggedOutput::finishis defensive-only (nothing readsself.callsafter finish). - Contributor standing. @lukealonso is a charter-named priority contributor; the PR meets the charter's four-part description format.
What it costs, and why it is not simply mergeable
- It deliberately reverses a documented invariant.
docs/api.md:447on main says "recognized but incomplete calls at natural completion are errors" — a pinned, restated decision from 99cfcd5be, reaffirmed in #67 and in #133. The PR rewrites that sentence. That is a policy change to the user-visible contract and arguably needs explicit maintainer sign-off, not just passing tests. - The evidence is synthetic, not captured. Every input is a hand-built string reconstructed from chat templates, split at every UTF-8 boundary. There is no captured model stream that fails today and succeeds after the patch, and no serving run on hardware. The charter is explicit: "hypothetical users aren't enough," and bug fixes must address a root cause rather than swallow an error. Worse, the one field report on this surface, #133, traced its
incomplete GLM tool callfailures to corrupted prepared graphs, not model habit — and after re-export went 1/84 → 0/84 tool parse rejections with 84/84 HTTP 200. The PR's premise ("models occasionally omit the closer") is plausible and partly supported by #67, but for GLM specifically the only hard evidence points the other way. Note that #578, opened the same day, does the equivalent DeepSeek argument recovery with a captured regression sequence and 120+20 live passes — that is the evidence bar this PR should meet. - It leaves the matrix inconsistent. DeepSeek DSML keeps
Err("incomplete DeepSeek tool call at end of response")(dsml.rs:379-380), and XTML, TML and recipient parsers get no EOS leniency, so the same model habit still hard-fails those recipes.docs/api.mdonly implies this. The charter's review standard says to "check interactions across every supported model." - It duplicates an open PR. #514 is the same goal on the same two files, open, and its auto-review already stopped with "low value or does not align with the project charter." #573 never mentions it, so as things stand the maintainers have two overlapping leniency PRs and no stated precedence — and #573 is the one whose premise was previously judged low value, which is exactly why it needs the extra evidence.
- A residual over-broadening is untested and undocumented.
GemmaCallandMiniMaxXmluse the trait-defaultstarts_call = Some(true)(tagged.rs:48-50), soconfirmedis always true for them. An unclosed but brace-balanced Gemma example call written in prose that previously errored at EOS now becomes an executed tool call. #67 already accepts this for closed examples (11 of 32 mention requests wrote complete example calls), so it is defensible, but the PR neither tests nor documents the change. The duplicate-close-tag behaviour flip from theouter_closedfix is likewise untested. - Minor footprint.
PlainTextin pipeline.rs gets a stubparse_eos(+108 lines, mostly tests) returning the same error it already returns — afn parse_eos(...) -> Result<Vec<…>> { Err(...) }default on the trait would delete that file's production change entirely.GemmaCall::parse_eosisparse_body(body, tools, true)where all structural checks already existed inparse_body, so it is 8 lines — fine, but the same "reuseparse" reasoning applies. Theself.callsincrement is dead bookkeeping. For a charter that asks for "the smallest footprint in shared code," these add up to visible noise around a genuinely small idea.
Required changes before merge
- Cite and supersede #514 explicitly (or close it) so there is one leniency line of work, and say which guardrails of #514 were rejected and why.
- Replace or supplement the synthetic evidence with one captured failing stream for GLM and for one function-tag model (before/after on the served path), or relabel the PR as a maintainer policy change and get explicit sign-off for reversing the documented "incomplete calls at natural completion are errors" rule. This is the charter's "bring real evidence" bar, and #578 shows it is achievable.
- Document and test the DSML/XTML/TML asymmetry — state in
docs/api.mdthat those parsers still reject omitted closers at EOS, and ideally file the follow-up rather than leaving the matrix silently inconsistent. - Shrink the footprint: default
parse_eostoErr(…incomplete…)on the trait and drop thePlainTextstub; keep theouter_closedfix (it is a real bug) but drop the no-opself.callsincrement or justify it with a test that reads it. - Add tests for the Gemma/MiniMax prose-mention broadening and the duplicate-close-tag behaviour change, and state both in the docs paragraph.
Bottom line
The idea is right and lands in the right layer: it converts a hard request failure into the call the model clearly meant, on the exact workflow the charter is built around, with the anti-fabrication, strict-tool and truncation guarantees intact and no per-model flags. The implementation is careful — I could not find a way it fabricates a call or steals text from content. What holds it back is not design but the charter's own evidence rule: the proof is template-derived, the one real field report on this path blames corrupted graphs, a documented invariant is reversed in passing, and a same-goal PR sits open beside it. Fix those five points and this is a merge.