Verdict: Not worth it (would need a maintainer policy decision and a rewrite before any merge)
The stated problem is real in principle — GLM can emit a complete argument-tag call and then hit EOS without </tool_call> — but this PR is the wrong fix, in the wrong layer, and it breaks a deliberately pinned behavior.
1. It breaks an existing test, and fabricates a tool call from prose
The load-bearing finding. glm_prose_may_mention_the_tool_call_tag (helios/src/grammar/strict.rs:3594-3721) builds a GLM OutputConfig with tools weather and lookup (:3613-3616) and then calls compile_presented_strict_tools(..., Some(&mut out_cfg.content)) (:3637-3639). That function mutates the presentation config: function["strict"] = Value::Bool(true) for every tool with a strict schema (strict.rs:1441-1449). Both tools have strict schemas.
It then asserts assert_unfinished_at_eos(&out_cfg, "Avoid <tool_call>weather") (:3669, helper at :3343-3348, i.e. finish(Eos) must be Err). Trace under this PR:
pushseesstarts_call("weather")→None(no terminator yet,argument_tags.rs:92-117) → text is held back, so nothing is emitted during streaming.finishsetsfinishing = true, sostarts_call'sNonefalls through tomarker = Some((at, true))(tagged.rs:712-721) →Mode::Tool, buffer"weather".TaggedTools::finish(Eos)takes the new lenient path →ArgumentTags::parse("weather")→split == body.len(), soname = "weather",rest = "", the loop is skipped and it returns[("weather", "{}")]—Okand non-empty (argument_tags.rs:31-91).- Events are emitted,
finishreturnsOk, and the test'sassert!(...is_err())fails.
So the model's answer text "Avoid <tool_call>weather" becomes a synthesized zero-argument weather tool call that the model never made, discarding the prose. That parse returns {} for a bare name is not speculative — the existing test at argument_tags.rs:170-201 asserts exactly calls[1]["function"]["arguments"] == "{}". The client then gets finish_reason: "tool_calls" (encode.rs:622-628) and executes a tool nobody asked for. This is precisely the "never fabricate calls" property that chatml::tests::terminal_cause_preserves_incomplete_call_errors_and_never_fabricates_calls (chatml.rs:855-887) guards for the sibling dialect.
Why the PR's verification missed it: the claimed command filters to -- output::argument_tags:: output::chatml::, which excludes grammar::strict::tests even though grammar is enabled transitively by server (helios/Cargo.toml:25). The posted "24 passed" is true but does not cover the affected area, so the PR description's evidence does not support the merge claim under the charter's "bring real evidence" rule.
2. It reverses a deliberate, documented, maintainer-level decision
docs/api.md:438-444: "Truncated tool envelopes are omitted and the response reports its output limit; recognized but incomplete calls at natural completion are errors." The PR does not touch the docs, so it makes the code contradict published behavior.- #133 (closed) documents that this asymmetry "was introduced deliberately in
99cfcd5b, pinned by the testoutput_limits_allow_incomplete_tools_but_eos_rejects_themin03074c11, and restated in #67," and that changing it "is a maintainer policy decision that would editdocs/api.md, not a defect fix." - #418 (merged) deliberately tightened GLM: "reject trailing unresolved
<tool_call>, bare tool names, and proper prefixes of<arg_key>or</tool_call>at EOS in GLM strict prose" — the exact class of output this PR now accepts.
3. It conflicts with the charter's architectural rule
The charter's Code Review Standards say: "No per-model special cases or flags: Keep shared runtime layers general rather than adding model-specific branches or flags." const LENIENT_EOS_CLOSE is a per-dialect policy flag on the shared ToolDialect trait, set true only for GLM (argument_tags.rs:29). Unlike the existing trait consts (OPEN, CLOSE, FUNCTION, TRIM_NEWLINES, TOOL_ENDS_REASONING), which all describe model syntax, this one describes error policy. The result is that byte-identical malformed output yields finish_reason: "tool_calls" on GLM and a terminal stream error on Qwen, DSML, and XTML — a model-dependent API contract, undocumented. That is the "good idea in the wrong place" the charter declines (#404).
4. Who benefits, how much, and the evidence
Little, and it is unquantified.
- Under strict mode the scenario cannot occur: the strict GLM wire grammar always emits the closing tag (
strict.rs:3758,:3883), so the benefit is confined to non-strict GLM requests. - The PR reports no capture, no repro, no frequency — just "occasionally emits." Per the charter ("hypothetical users aren't enough"; bug fixes must address the root cause, #397), that is not sufficient to reopen a settled policy.
- #133's measured data undercuts the premise: GLM tool-parse rejections were 1/84 on a corrupt export and 0/84 after the #129 re-export, with the parser described as "strict and unchanged: a malformed tool call from the model would still be rejected by design, and that documented behavior did not need to change."
- No maintainer request, issue, or roadmap item asks for this (searched; only #514 itself).
5. Cost
Small in lines (~60) and zero in steady-state performance (finish-path only, no decode/grammar cost). But the maintenance and risk cost is disproportionate: a new cross-cutting policy axis on the shared trait, a divergence in API semantics across dialects, docs that now lie, and one broken strict-mode test plus whatever else the author's narrower filter did not run. The self.calls index is also not advanced by the new branch (tagged.rs:304-329 vs the push path at :269-292), which is latent-index-fragile even though it is currently masked by GLM's single-call-per-<tool_call> shape.
6. Simpler ways to the same end
- If this is a real defect, fix the root cause where the data is: capture the failing GLM output and show the frequency on a clean export (post-#129). #133's evidence suggests the observed truncation was the corrupt graph, not the model.
- If the model genuinely truncates, fix it at generation, not presentation: the closing tag is in the template/grammar domain (Ignition recipe or strict wire grammar). That is model-agnostic and needs no runtime flag.
- If it truly must be presentation-level leniency, make it general and documented: apply it to all dialects, gate it on an explicit request/server option, update
docs/api.md:444, and — critically — require that a bare or empty-body envelope with no<arg_key>is rejected, so prose and bare function names can never become{}calls. That last constraint alone would fix the regression in §1 without touching the rest.
What would change the verdict
- A maintainer decision to relax the documented EOS policy (inherently their call, per #133).
- A reproducible capture with frequency on a clean export.
- A general, documented design with no prose/bare-name fabrication.
As written, this PR duplicates an intentional behavior, violates the no-per-model-flags standard, contradicts docs/api.md, and introduces a silent tool-call-fabrication path. Not worth merging. If a priority contributor asks for it, the review to send is: rebase the leniency into a general, documented mechanism, reject empty-body envelopes, and run the full runtime-core,server library suite including grammar::strict::tests.