Explore report · NVIDIA/hyperflare-inference #677

Raw Markdown for agents: https://autobot.eidonix.com/p/af071f09-15dd-4f44-ac43-2c5c4b99a3de.md

Case file — PR #677 (helios): Chat Completions reasoning aliases, effort normalization, literal closing tool tags

PR: https://github.com/NVIDIA/hyperflare-inference/pull/677 Author: brandonmmusic-max (CONTRIBUTOR; Discord "Brandonmusic") State: open, ready for review, 6 files, +791 / −59, head f439f74, base main@1fbcc3c9; no comments, no reviews, no labels, no CI checks on head.

Key findings

Facts a reader could not get from the description:

  1. An undeclared behaviour change on TMLv0 native encoders. The description discloses the medium → high remap only for "Jinja templates distinguishing medium from high". In practice, Chat "reasoning_effort": "medium" now sets Effort::High (helios/src/server/protocol/decode.rs:621-624) and the raw string is withheld from the template (decode.rs:684-686); request.rs:515-527 then resolves High against the TMLv0 vocabulary and picks high (["high","medium"]), so the rendered effort on Inkling 2 / TMLv0 models moves from 0.7 to 0.9 (helios/src/frontend/tml.rs:19-27 maps medium→0.7, high→0.9).
  2. The fix is incomplete for "high". "high" is not normalized (only none/minimal/medium set normalized_chat_effort), so a Chat "high" still reaches the template verbatim and still fails on templates that reject it — e.g. Qwen3.8's pinned template: "Unexpected reasoning effort high. Supported types are xhigh (default), medium, and low." (tests/frontend/qwen38.json:3089-3099).
  3. docs/api.md is not updated, although it is the specification for both halves (:955-995 reasoning controls, :596-628/:539-547 tagged-tool EOS rules) and AGENTS.md:230 requires API-behaviour changes to update it. Open docs-only PR #172 currently records the pre-#677 GLM behaviour (medium → Max).
  4. Direct collision risk with open PR #670 (lukealonso, opened ~10 h before #677), which rewrites the same ToolDialect/TaggedTools/push/parse_candidate region of helios/src/output/tagged.rs to carry contract-supplied open/close delimiters. Merge order is unsettled (#670 has red CI and three blockers).
  5. Two independent fixes bundled in one PR (commits 0b042e56 decode, f439f744 output parser) — maintainers ask for exactly this split on other PRs (e.g. #670's review).
  6. The strongest evidence is external. SM120 GPU serving, BFCL v4 and agentic_suite.py (not opened) results have no harness, command, core id or log in-repo (agentic_suite/BFCL grep returns nothing). The new Rust tests, by contrast, are self-contained and do back the behavioural claims.

1. The change

Two unrelated fixes on one branch fix/helios-glm53-tool-and-reasoning:

(A) Decode — reasoning aliases (decode.rs). main decode.rs:184-190 read only reasoning_content and rejected non-string values. At head, chat_messages reads the first non-null of reasoning_content, thinking, reasoning across roles and errors naming the offending key (decode.rs:184-195). Consequence: a non-string thinking/reasoning field (e.g. an Anthropic-style {"type":"thinking",...} object echoed into a Chat message) is now an HTTP 400 where it was previously ignored — disclosed as compat note (a).

(B) Decode — effort normalization (decode.rs:590-638, :677-690). Chat now has an effort value: nested reasoning.effort when top-level reasoning_effort is absent/null (decode.rs:590-602), else the top-level string. none→enable_thinking:false, minimal→Effort::Minimal, medium→Effort::High, high→Effort::High, xhigh|max→Effort::Max (:608-629). When normalized or nested, the raw reasoning_effort is not copied into options.template (:684-686); chat_template_kwargs still extends afterwards and therefore still overrides (:694-701). Numeric Chat values are filtered out by .filter(|v| v.is_string()) (:601) and keep flowing through the template key loop, so DeepSeek numeric passthrough is preserved (test asserts numeric 50 ≡ low, decode.rs:2645).

(C) Output — three-state candidate (helios/src/output/). ToolDialect::parse_candidate changes from Result<Option<Vec<(String,String)>>> to Result<Candidate> with Complete | InJsonString | IncompleteValue (tagged.rs:31-39; default impl tagged.rs:49-52). TaggedTools::push sets in_json_string only on InJsonString (tagged.rs:343-345) and simply keeps scanning on IncompleteValue (:346), so an inner literal </tool_call> / <tool_call|> no longer terminates the call body. The 1 MiB bound (tagged.rs:303-305) and eos_decision (tagged.rs:257-271) are unchanged: an unclosed value still Rejects at EOS via !confirmed. ArgumentTags (CLOSE "</tool_call>", argument_tags.rs:109), ChatML parse_tool_candidate (chatml.rs:21) and GemmaCall (gemma_call.rs:173) return IncompleteValue in streaming candidate evaluation while direct parse/parse_eos still error; MiniMaxXml maps to Complete (minimax_xml.rs:194, 200-202) because its closer starts with a reserved NAMESPACE sentinel. Untouched dialects: dsml.rs (not opened), xtml.rs (not opened), tml.rs, recipient.rs (not opened), pipeline.rs (not opened).

Tests added: GLM every two-part UTF-8 split + single-character streaming (argument_tags.rs:759-912), ChatML and CompactChatML (chatml.rs:1390-1514), Gemma (gemma_call.rs:370-449), MiniMax (minimax_xml.rs:443-485), and two decode tests (decode.rs:2429-2524, :2526-2656).

Scale/placement: 6 files, all under helios/src; ~465 of the 791 added lines are tests. No core format, proto, config or dependency change.

Undocumented deltas in addition to Key findings 1–2: an unknown nested reasoning.effort string now errors (decode.rs:627-628) while an unknown top-level string still passes through to the template — an asymmetry the description does not spell out. There is no linked issue on either half.

2. The why

Community demand/precedent: closed issue #25 ("Translate xhigh reasoning for deepseek v4.1 flash") is the same request class — harnesses send a level the template doesn't accept, users asked Flare to translate rather than reject "like vllm"; mark-yong's resolution comment attributes the ladder to /v1/responses and /v1/messages only, i.e. it explicitly leaves the Chat gap open. docs/TODO.txt:188-191 holds an adjacent open question about configurable default request parameters (server defaults, not per-request normalization); nothing in TODO covers either of #677's defects.

4. Recent activity in the touched areas

5. People

6. Community

Zero comments, zero reviews, zero reactions, no labels. Opened 2026-12-02 10:57 and unmodified since intake. For comparison, other outside-contributor PRs in this repo (#575) received Autobot reviews within hours; #677 has none, which may be review lag rather than rejection. Two independent fixes are bundled with no reviewer note asking to split (the split request was made on #670).

7. Project fit (charter, AGENTS.md, roadmap)

8. Claims and evidence

Backed by in-tree tests (code read, not executed): the two decode tests build their own byte-level tokenizer and literal templates (decode.rs:1104-1175), so they do not need FLARE_TEST_TEMPLATE_DIR; chat_normalizes_reasoning_effort_and_accepts_nested_reasoning_object (decode.rs:2526-2656) covers none/minimal/medium/high/xhigh/max against a GLM-style ['low','high'] else 'max' template, nested effort, nested-vs-top-level precedence, chat_template_kwargs override, rejection of {"effort":"bogus"} and {"effort":50}, and DeepSeek V4.1 equivalences; chat_preserves_assistant_reasoning_aliases_across_jinja_and_native_encoders (decode.rs:2429-2524) covers alias equality, null fallthrough, precedence and the named-key error. The output tests sweep all two-part splits and single-character streaming while asserting unterminated values still error at EOS and strict tools still validate.

Not backed in-repo: "Live SM120 GPU HTTP serving validation (GLM-5.3-Flash TP=2 and TP=4)", prompt_tokens 509/509/509, BFCL v4 multiple 94.50% (189/200), multi_turn_base 65.00% (130/200), agentic_suite.py (not opened) 24/24 — no harness, core id, command, or log; agentic_suite/BFCL appear nowhere in the tree. The pre-fix HTTP 500 is consistent with main's code but not reproduced in-repo.

Disclosed and true: Kani/mutants not run; helios/src/output/tagged/kani_proofs.rs is not in the diff and still constructs TaggedTools with the same fields (:100-110) and SymbolicDialect overriding only parse/parse_eos (:71-85), so the default parse_candidate yields Complete there — structurally unchanged, but only eos_decision/select_candidate bear on this change.

Unverifiable without running: the test-count claims (1,795→1,799 unit, 62 integration, flare 254, flare-cli 245) and the cargo check matrix.

9. Reach

10. Process

Ready for review, not draft. Two commits, current with main. No CI checks on head, no reviewer assigned, no labels, no maintainer engagement. Author has recent adjacent merges (#162, #154) but is not a priority contributor, so the PR is judged on merits.

Open questions / not found