Skip to content

fix(frontdoor): stop opting sessions into headroom's mid-turn queueing - #443

Merged
Mearman merged 1 commit into
mainfrom
fix/hop-no-mid-turn-optin
Oct 13, 2026
Merged

Mearman merged 1 commit into
mainfrom
fix/hop-no-mid-turn-optin

Conversation

@Mearman

@Mearman Mearman commented Oct 13, 2026

Copy link
Copy Markdown
Member

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-id from 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 answers 202 {"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/messages responses 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 under x-claude-code-session-id, which does not opt in.

Takes effect once the door is replaced. Refs #441.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-13T01:41:44.502408Z eabe70a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 62f3293 into main Oct 13, 2026
32 checks passed
@Mearman
Mearman deleted the fix/hop-no-mid-turn-optin branch October 13, 2026 01:38
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: eabe70ae7f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant