Case file: PR #637 "Bound synthesized tool-call IDs to 37 characters across HTTP protocols"
Fixes #447. Open, "ready for review", head d1508112, base main; +881/−7 in 3 files; CI failed on head; no reviews, no comments; opened and last updated 2026-11-30 11:40.
Key findings
- CI is red on the head commit while the description reports every suite passing (1803/245/227). The author ran only Linux aarch64 and explicitly states x86_64 and Windows builds "were not executed locally" — so the failure is unexplained and very plausibly on the x86_64/Windows legs of
.github/workflows/native-serving.yml(not opened) (PR #637 description, "Material limitations"; orientation packet). - The premise is contested, not established. The 40-character OpenAI/Azure limit — now asserted as fact in
docs/api.md:448and in a new code comment athelios/src/server/output.rs:17-19— traces only to issue #447's third-party link (https://github.com/BerriAI/litellm/issues/11392). Maintainer yatesdr commented on #447 (2026-11-21): the arithmetic holds, but "the only limit cited is a third-party report of Azure OpenAI rejecting 41 characters, so the client contract this should meet is not established yet." The PR does not answer that objection. - The PR never cites #176 (yatesdr, merged 2026-11-03, commit
cc696a6b), the change that created the{prefix}-{run:016x}-{seq}format being hashed. #637 silently re-encodes #176's uniqueness intent into a fixed width; the two need reading together. - Undeclared side effects: (a) tool-call IDs become opaque — previously the request ID (run + counter) could be read out of them, which matters for debugging/log correlation; the description does not mention this. (b)
ResponseOutput::closeand::applyreordering changes error-path behaviour (a rejected tool event no longer closes the open block;finish()becomes retryable), which is more than ID formatting. - A related unbounded ID is left alone: Responses
item.idis stillformat!("item_{}_{index}", self.id)(helios/src/server/protocol/encode.rs:268-270) and still grows with the counter. The description claims "<= 54 characters up toseq = u64::MAX"; the arithmetic gives 5 (item_) + 5 (resp-) + 16 (run) + 1 + up to 20 digits +_index≈ 49 at single-digit index, so the 54 figure is unexplained and the 64-char limit it is compared to is uncited in-repo. - Zero engagement: no comments, no reviews, no reactions, no labels; the only cross-reference anywhere is the bot's own comment on #447 announcing the branch. The PR text is essentially a re-post of that comment.
1. The change
The PR replaces two format! concatenations that build tool-call IDs with a hash helper, and reorders two validation steps in one state machine.
helios/src/server/output.rs (+418/−6)
use sha2::{Digest, Sha256};moved to module scope (output.rs:15); the pre-existing test-module import and the duplicate bring-in are gone. The gating claim holds:helios/src/lib.rs:29-30gatespub mod serverbehind#[cfg(feature = "server")], andhelios/Cargo.toml:22-25chainsserver→images→frontend→dep:sha2(sha2 = { version = "0.10.9", features = ["asm"], optional = true },Cargo.toml:147-149). NoCargo.tomlchange.- New constants and compile-time assert (
output.rs:17-22):MAX_SYNTHESIZED_TOOL_CALL_ID_LEN = 40,SYNTHESIZED_TOOL_CALL_ID_LEN = 37,const _: () = assert!(...). fn synthesize_tool_call_id(scope_id: &str, index: usize) -> String(output.rs:31-49): SHA-256 overb"flare-tool-call-id-v1\0",(scope_id.len() as u64).to_le_bytes(),scope_id.as_bytes(),(index as u64).to_le_bytes(); emitscall_+ first 16 digest bytes as 32 lowercase hex (output.rs:41-48), with twodebug_asserts on length.Accumulator::apply:format!("call_{}_{}", self.id, index)→synthesize_tool_call_id(&self.id, index)(output.rs:101); existing nonempty/unique validation retained (output.rs:102-104).ResponseOutput::close:if let Some(index) = self.open.take()→if let Some(index) = self.open { …; self.open = None; … }, so rejection of an unclosedBlock::Tool { ended: false, .. }no longer clearsself.open(output.rs:1714-1723).ResponseOutput::apply: synthesis + uniqueness validation now run beforeself.close(&mut changes)?(was after), and the Responses/Messages ID issynthesize_tool_call_id(request_id, index)(output.rs:1764-1789).
helios/src/server/protocol/tests.rs (+454/−0) — pure additions: assert_synthesized_protocol_tool_call_id, synthesized_tool_call_ids_stay_bounded_across_protocols_modes_and_restarts, synthesized_high_counter_tool_call_ids_round_trip_through_decode_and_template_messages.
docs/api.md (+9/−1) — one paragraph inserted at docs/api.md:441-451 in the "Model output parsers" section: deterministic 37-character call_<32 hex>, its hash inputs (request identifier embedding the random per-server-start run ID and monotonic counter, plus the Chat Completions choice index and the call index), the 40-character OpenAI Chat Completions maximum, and the [a-zA-Z0-9_-]+ alphabet.
Scope strings, verified: Chat Completions gets {request_id}_{choice} (encode.rs:130-131, Accumulator::new(format!("{id}_{i}"))); Responses and Messages get the bare self.id (encode.rs:567 self.outputs[index].apply(event, &self.id)), which is safe because only responses[0] is rendered there (e.g. encode.rs:280, :742, :756) and the call index alone disambiguates.
Does more than the description says: the opaque-ID consequence and the changed error-path semantics (see Key findings 4).
Says things the change does not do: the "nine native tool-call parsers" count (verified: 8 literal id: None sites in 7 files — argument_tags.rs:596 (not opened), dsml.rs:185 (not opened), recipient.rs:186 (not opened) and :279, tagged.rs:269 (not opened), tml.rs:361 (not opened) and :488, xtml.rs:209 (not opened)); and the "<= 54 characters" item_id figure.
2. The why
Issue #447, "Synthesized tool-call ids pass 40 characters once the request counter reaches 100000", by shieldstar, opened 2026-11-21 18:26, updated 2026-11-30, label area:api, still open.
- Reported shape:
call_chatcmpl-<16 hex run>-<seq>_<choice>_<index>; 40 chars atseq=99999, 41 atseq=100000; also hits atseq=10000with ≥10 tool calls. Repro is a CPU-only unit test drivingAccumulator, upstream25b4951, arm64, rust 1.94.1. Source map given:helios/src/server/http.rs:316(prefix),:321-325(id),protocol/encode.rs:127-129,output.rs:66and:67-69,output.rs:1357(Responses path). - Consequence claimed: OpenAI and Azure OpenAI reject
tool_calls[].id> 40 with HTTP 400string_above_max_length, so replaying conversations from long-running Flare servers across providers fails. - yatesdr (maintainer) replied 2026-11-21 18:38: the arithmetic holds at main
21a40f05, every parser leaves IDs to Flare so all models get synthesized IDs, "Flare documents no length limit, and the only limit cited is a third-party report of Azure OpenAI rejecting 41 characters, so the client contract this should meet is not established yet." - The bot replied 2026-11-30 11:41 confirming the repro on main
c146d7be, stating every native parser emitsid: None, and announcing the prepared branchfix/issue-447-bound-synthesized-tool-call-ids(commitd1508112= this PR's head). PR #637's body is a re-post of that comment.
Age and appetite: the issue is 9 days old at PR open; one human (yatesdr) engaged, and his objection was about the contract, not the arithmetic. Nothing shows a broader backlog of demand for this.
3. Related work
- #176 (yatesdr, merged 2026-11-03,
cc696a6b, +30/−2, "Keep request and tool-call IDs unique across server restarts") — the direct predecessor. It addedHttpState::run(random u64 from std hasher keys:helios/src/server.rs:165-166, 177-180, 324) and made request IDs{prefix}-{run:016x}-{counter}(http.rs:317-327; counterAtomicU64::new(1)atserver.rs:325). Its motivation: inside a container the pid was always 1, so every restart reissued identical IDs; Claude Code reported[Tool use interrupted]; chat templates pair tool results by ID (Kimi, Gemma, GLM). Live evidence quoted there: DeepSeek V4.1 Flash on SM120 behind Claude Code, 74 of 124 tool calls collided across restart before, 9/9 distinct after. #176 reasoned explicitly about tool-call IDs derived from request IDs — so #637 preserves #176's uniqueness goal while decoupling length, and is best read as a follow-up to #176. #637 never mentions it. - #638 (flare-autobot, opened 2026-11-30 11:40, head
f414393, +1316/−33, 9 files, open, 0 comments, "Echo Responses tools and text.format and decode tool output is_error", fixes #450) — same bot-published batch, same author. It toucheshelios/src/server/protocol/{decode,encode,tests}.rsanddocs/api.md, and both PRs append to the end ofprotocol/tests.rs; a textual conflict is likely if both merge. Different concern otherwise. No stacking is declared anywhere. - #418 (merged,
0b09434d, "Add strict function-tool schemas for DSML, Qwen, GLM and TML parsers") — added thestrict/pending_strict_callsbuffering path (encode.rs:502-556) that #637's new protocol test exercises ("Strict function tools (buffered viapending_strict_callsbefore re-emission)"). - #573 (merged,
2bdc8472, tolerate omitted closing tags at EOS) and #333 (merged, complete responses after one tool call when parallel calls are disabled) are adjacent tool-call semantics changes in the same files. - #513 (open, jannerchang) touches
helios/src/server/output.rsbut only theDecoder/logprobs region — no overlapping lines. #191, #170 (0794d5b8), #167 (902c88e2), #67 (a5b6ed26) also touchedoutput.rshistorically, not the ID code. - No competing or duplicate fix for #447 exists in the local copy. Nothing is superseded by #637, and the only thing it undoes is the raw
call_{request_id}_{index}/call_{scope}_{index}format introduced by #176's era.
4. Recent activity
- Base branch moves since the PR branched (
c146d7b): only0a8c20f4(#626, Luke Alonso, "Allow speculative reasoning for grammar-constrained requests") touches a file the PR changes — a different part ofdocs/api.md, so no textual conflict expected there. - The ID scheme itself last changed in
cc696a6b(#176, 2026-11-03);helios/src/server/output.rswas last touched by8628b7c5(2026-11-14, Luke Alonso, Inkling 2 Small NFP4) — unrelated, andd1508112(derek) is the newest commit in that file. - Recent helios/src work (#615, #619, #620, #626, #540, #582, #586) is all in scheduling/speculation/template territory — #637 builds on nothing there but conflicts with nothing either.
- The commit date on the change is 2026-11-29 while the PR was published 2026-11-30, consistent with a branch prepared quickly after the bot's #447 comment.
5. People
- Author of record:
flare-autobot(COLLABORATOR bot account; Discordflare-autobot). In the local copy: 0 merged, 0 closed, 2 open (#637, #638), plus #625 (eos THP compaction). The commit itself is authored byderek(search_historyonhelios/src/server/output.rs: "d1508112 2026-11-29 derek: Bound synthesized tool-call IDs to 37 characters across HTTP protocols"). Derek is a regular in that file (logprobs work:48bae6bb,2a65f7f3,2a4fcb9fera). - Reporter:
shieldstar— filed #447 with a precise reproduction and source map; no other items surfaced locally. - Only maintainer on record:
yatesdr— 47 commits inhelios/src, 55 indocs; author of #176 (the format in question) and the one who raised the unestablished-contract objection in #447. He is the natural reviewer. - Area ownership:
helios/src— Luke Alonso (229 commits), Martin Vit (52), yatesdr (47);docs— Luke Alonso (384). Recent touching PR authors: #513 jannerchang, #191 YouNeedCryDear, #418 Joshua Cartu, #573 Luke Alonso. - Engagement on the PR itself: none. No reviewer assigned, no labels.
6. Community
Zero comments, zero reviews, zero reactions on #637. The only cross-reference is the bot's own comment on #447 (2026-11-30 11:41) announcing the branch. For comparison, sibling bot-published PR #626 did receive an automated "Autobot Review" comment (Recommendation: Changes Requested, and it explicitly flags "CI on head f7907a2 is currently failing (unexplained)") — #637 has had no such pass yet, which is why the CI failure here carries no explanation. Interest drawn so far: effectively none beyond the issue thread.
7. Project fit
- Aligned. Charter's PR-description rule (why / what / claimed result / evidence) is fully met, plus a limitations section — above the repo's norm. Charter: "Bring real evidence… Bug fixes need to address the root cause" — #637 bounds the length at generation instead of truncating at output. Charter: "Keep the runtime small and model-agnostic… shouldn't accumulate per-model branches" — the change lives in the shared Helios HTTP/protocol layer and touches no parser, so it is model-agnostic. Charter "Supported matrix & compatibility: … verify that existing data, artifacts, and exported cores still load" — the diff touches no core/protobuf/contract code, so the claim is plausible, though untested by the PR.
- Tension. Charter non-goal: "It is not trying to be a general-purpose production server." The motivating scenario is a long-running, multi-provider, hosted Flare server past 100k requests being replayed through OpenAI/Azure — a production-hosting concern, and precisely what yatesdr flagged as an unestablished client contract. Also the repo targets "the documented subset of the OpenAI API, Anthropic Messages API and JSON Schema" (charter, Standards & Contributions), so a real-but-undocumented 40-char limit is arguably in scope — but the evidence brought is second-hand.
8. Claims and evidence
| Claim | What backs it | Verdict |
|---|---|---|
Every synthesized ID is 37 chars, ^call_[0-9a-f]{32}$, across seq 0…u64::MAX, multi-choice, ≤128 calls, streaming == buffered |
Structural: output.rs:41-48 writes exactly 5+32 chars; output.rs:17-22 compile-time assert; 4 new CPU tests (output.rs synthesized_tool_call_ids_are_bounded_deterministic_and_distinct, response_output_rejects_invalid_tool_begin_and_unclosed_close_without_partial_mutation; protocol/tests.rs synthesized_tool_call_ids_stay_bounded_across_protocols_modes_and_restarts, synthesized_high_counter_tool_call_ids_round_trip_through_decode_and_template_messages) |
Verified by inspection; tests mainly guard regressions |
| OpenAI/Azure reject > 40 chars | Only #447's LiteLLM link (https://github.com/BerriAI/litellm/issues/11392); no in-repo doc, no live request |
Not verified; the PR promotes it to a documented fact at docs/api.md:448 and output.rs:17-19 |
| Suite is green (1803/245/227, 0 failed) | Author's aarch64 run | Contradicted by CI on head; x86_64 and Windows never run locally |
| "Retains full 64-bit per-start run entropy" | Run value is hashed in as part of the scope | Imprecise: the ID carries 128 bits of the digest, not the run value; per-pair cross-host collision ~2⁻⁶⁴ — fine, but the phrasing overstates |
"Injective over (scope_id, index)" |
Length-delimited encoding at output.rs:35-38 is injective; the test asserts suffix cases ("scope_1",23 vs "scope_12",3) |
True of the input; the truncated 128-bit output is not mathematically injective. Practically covered by the per-response uniqueness checks (output.rs:102-104, 1769-1776) |
| Rejection leaves no partial mutation | New tests assert open/blocks/calls unchanged for empty/duplicate IDs and unclosed finish()/apply() |
Verified by the diff at output.rs:1714-1723, 1764-1789 and the new test |
| Previously exported cores still load | Diff touches no core/protobuf/contract code | Plausible, untested |
item_id "<= 54 characters up to seq = u64::MAX" |
None given | Arithmetic does not follow (~49 at single-digit index) |
| Live SDK behaviour | tests/server/test_protocols.py (not opened) not run (needs an exported core on SM103/SM120/SM121); 84 helios / 4 flare / 3 flare-cli ignored tests skipped; x86_64 + Windows unbuilt; scheduling sim / TLA+ / Kani skipped |
Openly acknowledged gaps; the live suite does exercise tool-call IDs (tests/server/test_protocols.py:282-344 (not opened), 547-567) |
No test reproduces #447's exact scenario against a served model past seq = 100000; the closest is a unit test at seq = 100_000.
9. Reach
- Clients: normal clients echo the ID back and are unaffected (
tests/server/test_minimax_m3.py:126(not opened),test_kimi3.py:124(not opened),test_inkling2.py:117(not opened)); chat templates pair tool results by ID viaorder_tool_result_batch(helios/src/server/inference.rs:393-415), which keeps working because IDs are stable within a response — the new round-trip test covers exactly this. Anyone who decoded information out of tool-call IDs loses it. - Operators: no config, default, env var, flag, wire format, protobuf, core format or dependency change.
x-request-id(set athttp.rs:39-42) and the response top-levelid(http.rs:317-327) keep the human-readable{prefix}-{run:016x}-{seq}. - Documentation as contract:
docs/api.md:441-451makes the 37-character format a published guarantee the project would then have to keep, and it publishes the 40-char maximum as fact. - Left unbounded: Responses
item.id(encode.rs:268-270) still grows with the counter; if a provider limit applies there (the PR says 64), large counters/high item indexes could still exceed it. - Uniqueness semantics: cross-restart and cross-host distinctness becomes probabilistic (128-bit truncation of a hash that includes the random run) rather than structural. Nobody has measured this against #176's intent.
- Deployment/hardware: no GPU, CUDA-graph, ABI, or async-lifetime interaction; the code is portable (no platform-specific additions), but Windows/x86_64 remain the untested matrix legs — and the ones CI is failing on.
- Documentation reach:
docs/api.mdis the client-facing contract document; the hunk overlaps sibling PR #638's edits to the same file.
10. Process
- State: open, "ready for review", no labels, no reviewers, no linked project items. Opened and last updated the same minute (2026-11-30 11:40) — no human interaction since publication; age 0 days.
- CI: failed on head
d150811. The pipeline that runs is.github/workflows/native-serving.yml(not opened): ubuntu-24.04 x86_64 + windows-2022 matrix,cargo test --locked --release --manifest-path helios/Cargo.toml --target-dir flare-cli/target --features runtime-core,serveron both OSes (lines 56-68), plus flare-cli (69-73), flare (74-77), eos/selene; template preppython tests/frontend/prepare_templates.py(not opened) with 7 recipes (line 31). No fmt/clippy step exists in any workflow. - Provenance: commit authored by derek (2026-11-29), PR body published by the flare-autobot account — a pattern shared with #625 and #638, so the "author" in GitHub terms is not the human doing the work.
Open questions / not found
- Why is CI red? Nothing in the PR or the issue explains it. The untested x86_64/Windows legs are the obvious candidate, but that is inference, not evidence.
- Is the 40-character limit real and is it OpenAI's Chat Completions API or Azure's? No in-repo source, no live verification, and yatesdr explicitly asked for this to be established before the change.
- Did anyone decide that #176's
run-based uniqueness may be truncated to 128 digest bits? No measurement or discussion of cross-restart/cross-host collision probability exists anywhere. - Should
item_id(encode.rs:268-270) be bounded too? The PR touches the file's sibling helper but leaves it unbounded and mis-states its bound; no issue tracks it. - Merge interaction with #638 — both edit
docs/api.mdand append toprotocol/tests.rs; no stacking order is declared, and neither has a review. - No maintainer has reviewed; the only human statement is yatesdr's pre-PR objection on #447. No reactions or community interest found beyond that thread.