Skip to content

Keep a Codex turn going while the relay catches up on the app-server's output - #431

Merged
abhishekgahlot2 merged 1 commit into
mainfrom
fix/codex-relay-backlog
Nov 6, 2026
Merged

abhishekgahlot2 merged 1 commit into
mainfrom
fix/codex-relay-backlog

Conversation

@abhishekgahlot2

@abhishekgahlot2 abhishekgahlot2 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor
  • The relay's queue for the host Codex app-server's output failed closed at 256 waiting lines, so a burst of deltas during a slow authorization step closed the relay and failed the turn ("The provider event stream closed unexpectedly").
  • The app-server's frames now queue without a limit; the sandbox's frames keep the fail-closed limit of 256.
  • New relay test: one frame's authorization is held while 600 lines arrive; all 600 arrive in order and the relay stays open.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…s output

The subscription relay authorizes and checks each line the host Codex app-server writes, one at a time, and the queue in front of that work failed closed once 256 lines waited. Codex writes bursts of hundreds of deltas faster than that, so a slow stretch closed the relay (1008, "serial task queue limit exceeded") and failed a healthy turn as "The provider event stream closed unexpectedly". Pausing the child's output does not help: Bun keeps delivering a child's stdout after pause().

The app-server's frames now wait without a limit; the sandbox's frames keep the fail-closed limit of 256. The new relay test holds one frame's authorization while 600 lines arrive; the old code closes the relay.
@abhishekgahlot2
abhishekgahlot2 merged commit f3bfcc3 into main Nov 6, 2026
20 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants