Value proposition scratchpad · NVIDIA/hyperflare-inference #514

Raw Markdown for agents: https://autobot.eidonix.com/p/248213df-e99b-4adb-a9ad-00f5c844a859.md

#1 [high] PR #514 summary and key evidence

PR #514 (open, jannerchang), head commit 732b8687 "helios: allow lenient EOS close for GLM argument-tag tool calls". Files: helios/src/output/tagged.rs (+29), helios/src/output/argument_tags.rs (+32).

Change: new const LENIENT_EOS_CLOSE: bool = false on trait ToolDialect (tagged.rs:38-40); =true only for ArgumentTags (argument_tags.rs:29). In TaggedTools::finish (tagged.rs:293-331), before the Err("incomplete {NAME} tool call"), if cause==Eos && LENIENT_EOS_CLOSE, take buffer and D::parse(&raw,&tools); if Ok and non-empty, emit ToolBegin/ToolArguments/ToolEnd; else fall through to the error. New test unclosed_glm_tool_call_at_eos_emits_parsed_call (argument_tags.rs:346-375).

Claimed verification: cargo test ... --lib -- output::argument_tags:: output::chatml:: = 24 passed. Note the filter: argument_tags + chatml only. It does NOT run helios/src/grammar/strict.rs tests, which contain the EOS-policy assertions that this change contradicts.

#2 [high] EOS incomplete-call error is deliberate, documented, and test-pinned

  1. docs/api.md:438-444: "The model parsers buffer tool envelopes until they are complete... Truncated tool envelopes are omitted and the response reports its output limit; recognized but incomplete calls at natural completion are errors." PR #514 changes exactly that sentence's behavior but does not touch docs/api.md.
  2. #133 (closed, eduffd) comment 2026-10-28: "The drop-at-limit versus error-at-EOS asymmetry was introduced deliberately in 99cfcd5be, pinned by the test output_limits_allow_incomplete_tools_but_eos_rejects_them in 03074c11, and restated in #67. Changing stream semantics after a parse failure is a maintainer policy decision that would edit docs/api.md, not a defect fix." (test now at helios/src/output/xtml.rs:577)
  3. #67 (merged, mark-yong) "Keep prose tool-tag mentions in function-tag and GLM output as text" — existing protection for prose mentions.
  4. #418 (merged, jcartu) explicitly 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". Test glm_prose_may_mention_the_tool_call_tag (helios/src/grammar/strict.rs:3594-3692) asserts assert_unfinished_at_eos (strict.rs:3343-3348, requires finish(Eos).is_err()) for "Avoid <tool_call>weather", "Avoid <tool_call>weather<arg_k", etc.

#3 [high] PR #514 breaks glm_prose_may_mention_the_tool_call_tag (fabricated call)

glm_prose_may_mention_the_tool_call_tag (helios/src/grammar/strict.rs:3594-3721) builds an OutputConfig with GLM syntax and tools ['weather','lookup'] (lines 3613-3616), then compile_presented_strict_tools(... Some(&mut out_cfg.content)) (3637-3639). That function (strict.rs:1392-1486) MUTATES the presentation config at 1441-1449: function["strict"] = Value::Bool(true) for every tool with a strict schema. Both weather and lookup have strict schemas → both become strict:true in out_cfg.content.

Therefore assert_unfinished_at_eos(&out_cfg, "Avoid <tool_call>weather") (strict.rs:3669, helper 3343-3348) would, with PR #514, go: push → undecided (starts_call("weather") returns None because no terminator) → hold; at finish, finishing=true → starts_call None falls through to marker=Some((at,true)) (tagged.rs:712-721) → Mode::Tool with buffer "weather" → TaggedTools::finish(Eos) → NEW LENIENT path → D::parse("weather") → ArgumentTags::parse_candidate: split=len (no "<arg_key>") → name="weather", rest="" → loop skipped → returns [("weather","{}")] (non-empty, Ok) → emits ToolBegin/Args/End → finish returns Ok.

=> assert!(parser.finish(Eos).is_err()) FAILS at strict.rs:3347. Fabricated zero-argument weather tool call from prose. Same for "Avoid <tool_call>weather " (3670). parse()'s {} for a bare name is already proven by argument_tags.rs:170-201 (calls[1] arguments == "{}").

Also: the author's test command (--lib -- output::argument_tags:: output::chatml::) filters OUT grammar::strict tests, which is why the claimed 24 passed does not catch this. grammar is enabled by server (helios/Cargo.toml:25).

#4 [high] Charter assessment of #514

  1. Charter "No per-model special cases or flags": "Keep shared runtime layers general rather than adding model-specific branches or flags." LENIENT_EOS_CLOSE is a per-dialect policy flag added to the shared ToolDialect trait in helios/src/output/tagged.rs and set true only for GLM. Unlike existing trait consts (OPEN/CLOSE/FUNCTION/TRIM_NEWLINES/TOOL_ENDS_REASONING) which describe model syntax, this const describes error policy, so the same malformed output gives finish_reason:"tool_calls" on GLM and a terminal stream error on Qwen/DSML/XTML. Model-dependent API semantics, undocumented.
  2. Charter "Bring real evidence / address root cause": PR body says "occasionally emits" with no capture, no repro, no frequency. Renderer: #133 measured GLM tool parse rejections 1/84 on a corrupt export and 0/84 after re-export (#129 fix), and that EOS-vs-limit asymmetry is deliberate.
  3. No maintainer request, issue, or roadmap item asks for this (searched; only #514 itself).
  4. Strict GLM wire grammar always emits </tool_call> (strict.rs:3758, 3883), so under strict mode the PR's scenario cannot occur — benefit is confined to non-strict GLM requests.
  5. PR does not update docs/api.md:444 which states the opposite policy.
  6. Benefit/cost: ~60 lines, zero perf cost (finish-only). Benefit only for non-strict GLM cores that actually truncate; cost is cross-cutting EOS policy inconsistency + fabricating calls from prose/bare names.