Repository navigation
fix: keep proxy-synthesized Responses item ids within the 64-char upstream cap (#242) - #244
Closed
ranxianglei wants to merge 1 commit into
Closed
ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
…tream cap (#242) - round-2 message id remap: deterministic short hash instead of embedding the full upstream id (66 chars → ~21) - sanitizeResponsesInputIds: heal already-poisoned rollouts at request ingress (deterministic msg-fix-<hash> rewrite, stable across requests) - regression tests with the exact 54-char id from the bug report
Contributor
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-244Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr244.tgz
npm install -g packageThis comment is automatically updated on each push. |
Owner
Author
This was referenced Sep 10, 2026
Merged
Merged
This was referenced Sep 20, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Model: qwen3.8-27b (vllm)
Fixes #242.
Root cause
When the Responses-API compress loop runs round 2+,
src/loop/adapter-responses.tsremapped upstream items with:origIdis the full upstream message id (e.g. 54 chars from Codex/OpenAI). With themsg-proxy-2-prefix that is 66 chars — over the upstream 64-char limit forinput[].id. Codex Desktop persists that id into its rollout; on every subsequent request the rollout replays it and upstream rejects:--passthroughdoes not help (the poisoned id is already persisted client-side). Affected: v0.1.53, Responses path (Codex).Fix (two parts)
1. Stop minting over-long ids — the round-2+ mapping now uses a deterministic FNV-1a base36 digest instead of embedding the upstream id:
≤ ~21 chars. All lifecycle events (output_item.added / output_text.delta / output_item.done) share the same mapped id, so references stay intact.
2. Heal already-poisoned rollouts —
prepareResponsesnow runssanitizeResponsesInputIds(parsed.input)(new export) before the projection reads the input: anyinput[].idlonger than 64 chars is rewritten in place tomsg-fix-${shortItemHash(id)}— deterministic and idempotent, so repeated requests keep referencing the same replacement id. Conversations that were permanently 400-ing recover on their next request.Not changed:
/responses/compact(native compaction never carries these ids — a poisoned rollout 400s on its first regular request before compact could run),call_idvalues, and the ~27-charmsg-proxy-${Date.now()}-…ids used by text/tool/marker emission (already within the cap).Tests
sanitizeResponsesInputIds: short ids untouched, deterministic (same source → same replacement),call_iduntouched, idempotent on re-run, non-array tolerated.msg-proxy-2-prefix assertion) still passes.