Repository navigation
fix(frontdoor): stop opting sessions into headroom's mid-turn queueing - #443
Merged
Merged
Conversation
The hop re-set x-headroom-session-id from the launch's session id so the daemon would attribute savings to a session. Headroom also reads that header as an opt-in to mid-turn queueing: while one stream is active for a session, another streaming request carrying it is answered 202 with a headroom_queued JSON body and never reaches the upstream. A client expecting an event stream reports "Streaming response ended before any complete data was received" and retries without streaming. Roughly 40 percent of a day's messages responses through the daemon were these. The hop no longer sends headroom's own session header, and still strips any inbound copy. Headroom already prefers the x-claude-code-session-id every Claude Code request carries for attribution, so the launch's id is filled in under that header only when the client sent none.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
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.
The "Streaming response ended before any complete data was received. Retrying without streaming." error came from the hop, not from a reset or a door replacement.
The hop re-set
x-headroom-session-idfrom the launch's session id (8b0c970) so headroom would attribute savings to a session. Headroom also treats that header as an opt-in to mid-turn queueing: when a second streaming request arrives for a session whose stream is active, it answers202 {"status":202,"event":"headroom_queued"}(40 bytes) and never calls the upstream. Claude Code expects an event stream, finds none, and retries without streaming. In one day's headroom log, 1002 of 2305/v1/messagesresponses were these 202s, and every request in that log carried the header. Concurrent requests under one session id are normal: subagents, forks, summaries and tool-result continuations.Every Claude Code request already carries
x-claude-code-session-id(3991 of 3991 requests that day), which headroom prefers for attribution, so the extra header added nothing on that path. The hop now never sends headroom's own header and still strips any inbound copy. A client that sends no session header of its own is attributed from the launch id underx-claude-code-session-id, which does not opt in.Takes effect once the door is replaced. Refs #441.