#1 [high] PR #573 already merged into main
PR #573 "helios: tolerate omitted closing tags on complete tagged tool calls at EOS" by lukealonso (COLLABORATOR, charter-named priority contributor).
- Merged 2026-11-28 21:17 into main. Merge commit 2bdc8472 on main ("helios: tolerate omitted closing tags on complete tagged tool calls at EOS (#573)"). PR head 701ddd4.
- PR files at head: 13 files, +1937/-104. All five review lenses saw only 9 files / +1423/-70 (head 09cc524). So the head advanced AFTER review: added helios/src/output/tagged/kani_proofs.rs (+176, new), helios/src/lib.rs (+2-1), .github/workflows/helios-lifecycle.yml (+1-1), verification/helios-lifecycle/README.md (+35-6).
- Consequence: pre-test gate premise is inverted — code is already on main, so testing is now post-merge validation, and only a discovered regression would cause rework.
- Only discussion on PR is the autobot case-file comment. Author never replied to any review.
- #514 (competing GLM-only per-model-flag PR, auto-stopped as "low value") was CLOSED 2026-11-28 21:18 by lukealonso with comment "Superseded by #573" — so the value-prop finding "never cites #514" was resolved at merge.
#2 [high] Merged-state verification: which review findings survive
Merged state (main 2bdc8472 = PR #573) — I read the code, not just the diff. Findings by severity:
STILL VALID BUT NON-BLOCKING (cleanliness, no behavior risk):
ToolDialect::parseis production-dead for 3 dialects. TaggedTools::push callsparse_candidate(tagged.rs:320 area), finish callsparse_eos. ArgumentTags/FunctionTags/MiniMaxXml override parse_candidate, so theirparseimpls have no non-test production caller. Only trait-default parse_candidate (tagged.rs:40-42) uses parse, reached by GemmaCall and PlainText. (Conventions S2 / Subtractive #2.)- Strict-tool lookup idiom duplicated 4x: gemma_call.rs:123-129, minimax_xml.rs:162-166, argument_tags.rs, plus different spellings in dsml.rs / recipient.rs. No shared
function()/is_strict()helper. (Conventions S1.) - MiniMaxXml parse_candidate (minimax_xml.rs:200-202) and parse_eos (203-205) are identical
parse_body(.., true); the trait's documentedNonesignal (tagged.rs:39 "None means the apparent closing tag is text inside a JSON string") is unreachable for MiniMax. Harmless because XML has no JSON strings. (Conventions S3.) - Cosmetic but user-visible error text: gemma_call.rs:128
"incomplete strict Gemma call tool call"— garbled ("call" doubled). argument_tags.rs says "incomplete strict GLM tool call". (Simplicity D4.) - docs/api.md states the recovery contract twice: :447-451 (general) and :514-525 (per-dialect, different exclusion list — only the second mentions output limits/stop sequences). (Architecture nit / Conventions S4 / Simplicity D5 / Subtractive #6.)
- Three names for one leniency flag:
eos(argument_tags.rs, gemma_call.rs),allow_unclosed_function(chatml.rs),allow_unclosed_invoke(minimax_xml.rs). (Conventions S2.) - Test bloat: ~700-760 of 1423 added lines deemed removable by Subtractive lens (5x3 protocol matrix, every-UTF-8-split re-runs, 4x copy-pasted non-EOS cause loop, 101-line logprobs test). This is a maintainability cost, NOT a behavior risk — and since merged, it is not rework of untested code.
- Docs asymmetry: docs/api.md:511-512 names DSML and XTML as "their own parsers rather than this path", but TML (tml.rs) and recipient.rs EOS recovery are not mentioned, and those remain strict. (Architecture nit 2 / Conventions nit 2.)
RESOLVED SINCE REVIEW (correctness reviewer's 2 open questions both settle in the code's favor):
- GemmaCall
parse().remove(0)panic risk: GONE. Merged gemma_call.rs:147-149 isparse_eos -> Self::parse_body(body, tools, true)returning a Vec directly; merge refactor removed the indexing. No empty-vec panic path. - "MiniMax/Gemma non-EOS leniency untested": NOW TESTED. minimax_xml.rs test asserts recovery closed by
</tool_call>mid-stream; chatml test asserts</tool_call>-closed case; protocol tests cover</tool_call>-closed unclosed-inner for qwen/mimo/minimax. - Author did NOT resolve any review intent question in-thread (zero replies); merged anyway.
CORRECTLY REJECTED AS INVALID (do not repeat in report as problems):
- "lenient at EOS" vs "also at outer closer": intended, documented in docs/api.md:519,522, and tested. Correctness lens called it a title-framing nit only.
- No per-model boolean flag: CORRECT. Single required trait method
parse_eos(tagged.rs:45); gating is onstrict(a request field) not model identity. Matches charter "no per-model special cases or flags" and design-review.md:58-61. This is strictly better than #514'sconst LENIENT_EOS_CLOSE: bool. - #514 not cited: RESOLVED at merge — lukealonso closed #514 2026-11-28 21:18 with "Superseded by #573".
- "parse_eos should have a trait default": reviewers disagreed. Simplicity lens explicitly argues a default would make every dialect lenient and defeat anti-fabrication. Do NOT recommend adding a default.
- Subtractive's "calls += ToolBegin bump is unobservable / delete it": WRONG. New test tagged.rs covers post-finish
parser.calls == 3and indices [1,2]. Keep it; do not propose deleting.
#3 [high] Scope: CPU-only parser; only untested layer is served end-to-end
All changed code is CPU-side model-output parsing. No CUDA, no kernels, no scheduling/cache/admission changes. So a GPU is needed ONLY to produce real model tokens, not to exercise the change.
Verification already in place (so hardware testing should not redo it):
- Kani formal proofs (11/11 harnesses, per PR): partial_marker_ascii_matches_oracle, partial_marker_utf8_preserves_char_boundaries, tagged_tools_eos_decision_enforces_termination_and_confirmation, select_candidate_picks_earliest_closer_and_tracks_outer_closed. I read kani_proofs.rs at main: proofs are self-consistent (oracle-based, cover properties, bounded domains, mem::forget to isolate Arc drop). They do NOT prove dialect grammars or serde_json decoding — correctly disclosed.
- cargo-mutants 27.1.0: 168 mutants, 157 caught, 7 unviable, 2 timeouts, 2 missed; both missed are documented mathematically-equivalent mutants. Unusually strong signal.
- 206 unit/protocol/logprob/grammar tests pass; deepseek_output 14 passed; 4 grammar tests ignored (checkpoint-gated).
- Protocol test unclosed_tagged_tool_calls_at_eos_match_protocol_and_control_semantics covers 5 dialects x 3 protocols x 6 scenarios (auto/required/named, parallel_tool_calls:false, OutputLimit, UserStop).
NOT run by author (disclosed) — this is the real residual gap and the only good reason for hardware:
- Live GPU serving. No captured model stream exists that fails before and succeeds after.
- Checkpoint-gated integration tests: FLARE_*_TEST_SNAPSHOT (reasoning_delimiters, glm_frontend, parser_start), 4 ignored grammar:: tests, FLARE_TEST_TEMPLATE_DIR test. These are exactly the tokenizer/grammar end-to-end layer.
WHY END-TO-END MATTERS HERE — the premise is unverified:
- Premise "GLM/Qwen/Gemma/MiniMax omit their closing tag at EOS" has NO captured generation attached to the PR for any dialect.
- Best supporting precedent: #67 (merged, same author) MEASURED Qwen3.8 Flash ending turn where
</tool_call>would follow: 7 of 20 logprob requests,<|im_end|>~0.97 vs</tool_call>~0.02. That is real evidence for the function-tag/Qwen dialect only. - COUNTER-evidence for GLM specifically: #133. The only field report on the GLM EOS path traced
incomplete GLM tool callto corrupted prepared graphs (fixed by #129), and explicitly listed the EOS-error asymmetry as "not reproduced as a defect". After re-export: tool parse rejections 1/84 -> 0/84, 84/84 HTTP 200. So for GLM the one hard data point points the other way. - Therefore a served run is the highest-value check available AND the cheapest way to settle the architecture lens's should-fix (claim-to-evidence binding, AGENTS.md:103-112).
#4 [high] Hardware test feasibility: mapping, gaps, and risks
Recommendation: YES, small hardware test — one host (cn5), one GLM core, ≤35 requests, ≤45 min. Framed as post-merge validation, not a merge gate (PR already merged as 2bdc8472).
A/B throughput benchmark: NOT applicable / explicitly excluded. The change is CPU-side parser code off the decode hot path (runs once per completed tool envelope). A throughput delta would be noise and would waste the job.
Where the dialects are chosen: dialect comes from the prepared core's OutputConfig (ToolParserKind, helios/src/model/contract.rs:67), recorded by ignition at preparation time. Recipe code lives in an EXTERNAL repo (local-inference-lab/hyperflare-recipes, per docs/model-preparation.md:310-326) — so I CANNOT verify from this repo which ToolParserKind each host model uses. Must be confirmed on-host with flare inspect. This is a precondition, not an assumption.
Host model → dialect mapping (docs-implied, must confirm with flare inspect):
- cn5: facebook/dinov2-base (vision only — NO tool parsing), nvidia/ + local-inference-lab/GLM-5.3-Flash-NVFP4 (GLM argument tags → ArgumentTags, changed), timm/vit_base_patch14 (vision only).
- cn7: nvidia/Qwen3.8-27B-NVFP4, nvidia/Qwen3.8-Flash-Next-FP4-Local, incoai/Qwen3.8-27B-DFlash2 (Qwen function tags → FunctionTags/QwenCoder, changed), zai-org/GLM-5.3-Flash (ArgumentTags, changed), nvidia/GLM-5.3-Flash-FP4-Local (changed).
- NO Gemma 4 and NO MiniMax M3.1 checkpoint on either host, even though both dialects are changed. Cannot be end-to-end tested with available hardware — must be stated as a coverage gap, not covered by a workaround.
- cn5 is preferred: amd64, 4x96 GiB, 48 CPUs. cn7 arm64 adds nothing (parser code is arch-independent).
MAIN PRACTICAL RISK to hardware-time efficiency: serving needs a PREPARED CORE (flare run <core>), not a raw HF checkpoint. The host model list reports "0 GiB" entries, which may just be cached HF references. If no prepared core exists for GLM, this job becomes a multi-hour ignition preparation job rather than a 45-minute parser test. Precondition: confirm a prepared core exists (flare inspect / core cache) BEFORE allocating the job.
Serve/verify entrypoints (verified): flare run (Command::Run, flare-cli/src/cli.rs:45) serves; flare inspect (cli.rs:49) prints the core's contract incl. tool parser kind.
The harness CANNOT force a model to omit its closing tag. Honest limitation of any end-to-end test here. Best available technique for raising incidence: use the #67 shape — ask the model about its own chat template / tool tags, which is the measured condition where omission occurred (Qwen3.8 Flash: <|im_end|> ~0.97 vs </tool_call> ~0.02, 7 of 20 logprob requests). Treat a 0-sample result as a finding, not a reason to inflate N.
#5 [high] Minimal hardware test plan (GLM-first, cn5)
GOAL: allow a non-strict tagged tool call whose argument body is structurally complete and self-delimited at natural EOS (plus at the outer </tool_call> closer for function-tag and MiniMax dialects), while rejecting undecided openers, bare headers, unclosed arguments, trailing text, strict tools, and all non-EOS terminations.
ONE-LINE TEST: Bash POST /v1/chat/completions against the served GLM core with tools present + tool_choice:"auto".
- (a) #67-shape prompt (ask the model to describe its own tool-call tags) ~10x, assert 0 HTTP 500s. PRIMARY ANTI-REGRESSION ASSERTION: no
incomplete GLM tool call(or any parser) error frame. - (b) 10 ordinary tool-using prompts, assert
finish_reason:"tool_calls", arguments parse as the declared JSON types, and streamedtool_calls[].function.argumentsdeltas concatenate to exactly the bufferedfunction.arguments. - (c)
strict:trueGLM tool: assert it still fails / is refused, never silently recovered. (Ties to grammar/strict.rs admission.) - (d)
max_tokenstruncation: assert finish_reasonlengthand the unclosed call is OMITTED (no tool_calls), i.e. truncation still omits — the guarantee the PR must not break. - (e) On cn7 only: same for Qwen (function tags) if it is second priority.
- (f)
flare inspectthe core: record ToolParserKind, confirm it is GLM_ARGUMENT_TAGS / QWEN_CODER and not DSML/XTML/TML/ATEM (unchanged dialects → test would be meaningless).
A/B COMPARISON: only worth it for (a) if you also capture a reused 5-min pre-merge binary/core. Otherwise skip — the parser is a closed system fully covered by 206 tests + Kani + 168 mutants.
DO NOT test: throughput, latency, KV/prefix cache, multi-GPU/TP, MTP/speculation, CUDA graph capture, Dinov2/vit (no tools), Gemma 4 / MiniMax M3.1 (no checkpoint on either host).