Skip to content

Increase app-server WebSocket outbound buffer#19246

Merged
etraut-openai merged 1 commit intomainfrom
etraut/increase-client-buffer-size
Apr 24, 2026
Merged

Increase app-server WebSocket outbound buffer#19246
etraut-openai merged 1 commit intomainfrom
etraut/increase-client-buffer-size

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented Apr 24, 2026

Fixes #18203.

Why

Remote TUI clients connected through codex app-server --listen ws://... can receive short bursts of outbound turn and tool-output notifications. The WebSocket transport previously used the shared 128-message channel capacity for its outbound writer queue, so a healthy client that briefly lagged during normal output streaming could fill the queue and be disconnected immediately.

This is a smaller mitigation than #18265: instead of adding a new overflow/backpressure pipeline, keep the existing non-blocking router behavior and give WebSocket clients enough bounded headroom for realistic bursts.

What Changed

  • Added a WebSocket-only outbound writer capacity of 64 * 1024 messages.
  • Used that larger capacity only for the WebSocket data writer queue in codex-rs/app-server/src/transport/websocket.rs.
  • Left the shared CHANNEL_CAPACITY and the existing disconnect-on-full behavior unchanged for internal/control channels and genuinely stuck clients.

Verification

@etraut-openai etraut-openai marked this pull request as ready for review April 24, 2026 00:49
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a41f2972a6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/app-server/src/transport/websocket.rs Outdated
@etraut-openai etraut-openai force-pushed the etraut/increase-client-buffer-size branch 2 times, most recently from 16450ba to 8088efd Compare April 24, 2026 00:54
Copy link
Copy Markdown
Contributor

@maxj-oai maxj-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice let's give it a shot!

@etraut-openai etraut-openai merged commit 72f757d into main Apr 24, 2026
25 checks passed
@etraut-openai etraut-openai deleted the etraut/increase-client-buffer-size branch April 24, 2026 01:47
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 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.

App-server disconnects remote TUI mid-turn when outbound queue fills (128 messages)

2 participants