Skip to content

[exec-server] serve websocket listener via HTTP upgrade#21963

Merged
euroelessar merged 10 commits into
mainfrom
ruslan/exec-server-http-upgrade
May 12, 2026
Merged

[exec-server] serve websocket listener via HTTP upgrade#21963
euroelessar merged 10 commits into
mainfrom
ruslan/exec-server-http-upgrade

Conversation

@euroelessar

@euroelessar euroelessar commented May 9, 2026

Copy link
Copy Markdown
Collaborator

Why

codex exec-server should keep the existing public ws://IP:PORT URL shape while serving that websocket connection through an HTTP upgrade path internally. That keeps the client-facing configuration simple and allows the listener to work through intermediate HTTP-aware infrastructure.

What changed

  • keep the emitted and configured exec-server URL as ws://IP:PORT
  • serve that websocket endpoint through Axum HTTP upgrade handling on /
  • expose GET /readyz from the same listener for readiness checks
  • route upgraded Axum websocket streams through the shared JSON-RPC connection machinery
  • initialize the rustls crypto provider before websocket client connections
  • preserve inbound binary websocket JSON-RPC parsing for compatibility with the prior transport behavior

Verification

  • cargo test -p codex-exec-server --test health --test process --test websocket --test initialize --test exec_process

@euroelessar euroelessar force-pushed the ruslan/exec-server-http-upgrade branch 3 times, most recently from 7cc55f4 to 6f40914 Compare May 9, 2026 21:49
@euroelessar euroelessar changed the title [codex] add exec-server HTTP health endpoints [exec-server] serve websockets via HTTP upgrade May 11, 2026
@euroelessar euroelessar changed the title [exec-server] serve websockets via HTTP upgrade [exec-server] serve websocket via HTTP upgrade May 11, 2026
@euroelessar euroelessar marked this pull request as ready for review May 11, 2026 21:44
Comment thread codex-rs/exec-server/tests/common/exec_server.rs
@euroelessar euroelessar changed the title [exec-server] serve websocket via HTTP upgrade [exec-server] add optional HTTP-upgrade websocket mode May 11, 2026
@euroelessar euroelessar changed the title [exec-server] add optional HTTP-upgrade websocket mode [exec-server] refactor websocket connection handling May 11, 2026
Self::from_websocket_parts(websocket_writer, websocket_reader, connection_label)
}

pub(crate) fn from_axum_websocket(stream: AxumWebSocket, connection_label: String) -> Self {

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.

no longer used?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

still used, my local git state was a bit confused, fixed

@euroelessar euroelessar changed the title [exec-server] refactor websocket connection handling [exec-server] tighten websocket transport setup May 11, 2026
@euroelessar euroelessar changed the title [exec-server] tighten websocket transport setup [exec-server] serve websocket listener via HTTP upgrade May 11, 2026
@euroelessar euroelessar force-pushed the ruslan/exec-server-http-upgrade branch from 43b6890 to cb75189 Compare May 11, 2026 22:40
@euroelessar euroelessar merged commit 95d8669 into main May 12, 2026
27 checks passed
@euroelessar euroelessar deleted the ruslan/exec-server-http-upgrade branch May 12, 2026 00:04
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 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