Skip to content

Conversation

@maxj-oai
Copy link
Contributor

@maxj-oai maxj-oai commented Feb 10, 2026

Reapply "Add app-server transport layer with websocket support" with additional fixes from https://github.com/openai/codex/pull/11313/changes to avoid deadlocking.

This reverts commit 47356ff.

Summary

To avoid deadlocking when queues are full, we maintain separate tokio tasks dedicated to incoming vs outgoing event handling

  • split the app-server main loop into two tasks in run_main_with_transport
    • inbound handling (transport_event_rx)
    • outbound handling (outgoing_rx + thread_created_rx)
  • separate incoming and outgoing websocket tasks

Validation

Integration tests, testing thoroughly e2e in codex app w/ >10 concurrent requests

Screenshot 2026-02-10 at 2 54 22 PM

@maxj-oai maxj-oai changed the title codex-rs/app-server: split incoming and outgoing loops Reapply "Add app-server transport layer with websocket support" Feb 10, 2026
@maxj-oai maxj-oai force-pushed the maxj/app-server-split-loops branch from 638b825 to 7560a70 Compare February 10, 2026 22:51
@maxj-oai maxj-oai marked this pull request as ready for review February 10, 2026 22:55
@maxj-oai maxj-oai requested a review from owenlin0 February 10, 2026 22:55
Copy link
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: 7560a70d4e

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

@etraut-openai etraut-openai added the oai PRs contributed by OpenAI employees label Feb 11, 2026
Copy link
Collaborator

@jif-oai jif-oai left a comment

Choose a reason for hiding this comment

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

This transfer the back pressure to the ingress in practice so it means we rely on the ingress to error/drop events once everything is full.

I would prefer an explicit handling on our side instead but this can be done in a follow-up

This reverts commit b254b72.
…r-split-loops

# Conflicts:
#	codex-rs/app-server/src/transport.rs
…-loops

# Conflicts:
#	codex-rs/Cargo.lock
#	codex-rs/app-server/src/lib.rs
Copy link
Collaborator

@jif-oai jif-oai left a comment

Choose a reason for hiding this comment

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

I think we lost optOutNotificationMethods (we should have a use of should_skip_notification_for_connection). Maybe it's just because we need to merge main

The rest lgtm but I guess we will iterate on this code. It's getting quite complex

@maxj-oai maxj-oai enabled auto-merge (squash) February 11, 2026 18:08
@maxj-oai maxj-oai merged commit 7053aa5 into main Feb 11, 2026
44 of 50 checks passed
@maxj-oai maxj-oai deleted the maxj/app-server-split-loops branch February 11, 2026 18:13
@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants