Skip to content

feat(exec-server): use protobuf relay frames#22343

Merged
apanasenko-oai merged 6 commits into
mainfrom
codex/relay-multiplexed-exec-server
May 12, 2026
Merged

feat(exec-server): use protobuf relay frames#22343
apanasenko-oai merged 6 commits into
mainfrom
codex/relay-multiplexed-exec-server

Conversation

@apanasenko-oai

@apanasenko-oai apanasenko-oai commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Why

Remote exec-server now needs one executor websocket to serve multiple harness JSON-RPC sessions. Rendezvous routes by stream_id, and the exec-server side needs to use the same stable relay frame contract instead of a hand-rolled JSON shape.

The relay protocol also needs to make ownership boundaries clear: harness and executor endpoints own sequencing, acks, retries, duplicate suppression, segmentation, and reassembly; rendezvous only routes frames.

What Changed

  • Add the checked-in codex.exec_server.relay.v1.RelayMessageFrame proto plus generated prost bindings for codex-exec-server.
  • Encode remote harness/executor relay traffic as binary protobuf websocket frames while keeping local websocket JSON-RPC unchanged.
  • Demux executor-side relay streams into independent ConnectionProcessor sessions keyed by stream_id.
  • Add a programmatic RemoteExecutorConfig::with_bearer_token(...) constructor for non-CLI callers and integration tests.
  • Add an integration test that starts the remote executor against a fake registry/rendezvous websocket and verifies two virtual streams share one executor websocket without cross-talk, including per-stream reset behavior.
  • Document the remote relay envelope, sequence ranges, ack/ack_bits, and endpoint responsibilities in exec-server/README.md.

Verification

  • cargo test -p codex-exec-server --test relay multiplexed_remote_executor_routes_independent_virtual_streams -- --exact
  • cargo test -p codex-exec-server --test relay
  • cargo test -p codex-exec-server passed outside the sandbox. The sandboxed run hit macOS sandbox-exec: sandbox_apply: Operation not permitted in filesystem sandbox tests.

@apanasenko-oai apanasenko-oai marked this pull request as ready for review May 12, 2026 15:36

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

Copy link
Copy Markdown
Contributor

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: f45499cfa1

ℹ️ 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/exec-server/src/relay.rs
Comment thread codex-rs/exec-server/src/relay.rs
@apanasenko-oai apanasenko-oai changed the title feat(exec-server): add relay multiplexing feat(exec-server): use protobuf relay frames May 12, 2026
Comment thread codex-rs/exec-server/src/client_transport.rs
@apanasenko-oai apanasenko-oai merged commit ac466c0 into main May 12, 2026
27 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
@apanasenko-oai apanasenko-oai deleted the codex/relay-multiplexed-exec-server branch May 12, 2026 23:50
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.

3 participants