Skip to content

app-server: add Unix socket transport#18255

Merged
euroelessar merged 4 commits intomainfrom
ruslan/app-server-unix-socket
Apr 23, 2026
Merged

app-server: add Unix socket transport#18255
euroelessar merged 4 commits intomainfrom
ruslan/app-server-unix-socket

Conversation

@euroelessar
Copy link
Copy Markdown
Collaborator

@euroelessar euroelessar commented Apr 17, 2026

Summary

  • add unix:// app-server transport backed by the shared codex-uds crate
  • reuse the websocket connection loop for axum and tungstenite-backed streams
  • add codex app-server proxy to bridge stdio clients to the control socket
  • tolerate Windows UDS backends that report a missing rendezvous path as connection refused before binding

Tests

  • cargo test -p codex-app-server control_socket_acceptor_forwards_websocket_text_messages_and_pings
  • cargo test -p codex-app-server
  • just fmt
  • just fix -p codex-app-server
  • git -c core.fsmonitor=false diff --check

@euroelessar euroelessar force-pushed the ruslan/uds-stdio-to-uds branch from 7d60a42 to 32adbbe Compare April 17, 2026 03:35
@euroelessar euroelessar force-pushed the ruslan/app-server-unix-socket branch 2 times, most recently from 986fdd5 to ecd2554 Compare April 17, 2026 04:22
@euroelessar euroelessar marked this pull request as ready for review April 17, 2026 22:44
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: ecd2554fb8

ℹ️ 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/unix_socket.rs
Copy link
Copy Markdown
Collaborator

@viyatb-oai viyatb-oai left a comment

Choose a reason for hiding this comment

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

Reviewing in the context of SSH remote control over Unix sockets.

Comment thread codex-rs/app-server/src/transport/unix_socket.rs Outdated
Base automatically changed from ruslan/uds-stdio-to-uds to main April 20, 2026 22:59
@euroelessar euroelessar force-pushed the ruslan/app-server-unix-socket branch 2 times, most recently from bdb0567 to 6469e20 Compare April 20, 2026 23:32
- add unix:// app-server transport backed by the shared codex-uds crate
- reuse the websocket connection loop for axum and tungstenite-backed streams
- add codex app-server proxy to bridge stdio clients to the control socket
- tolerate Windows UDS backends that report a missing rendezvous path as connection refused before binding

- cargo test -p codex-app-server control_socket_acceptor_forwards_websocket_text_messages_and_pings
- cargo test -p codex-app-server
- just fmt
- just fix -p codex-app-server
- git -c core.fsmonitor=false diff --check
@euroelessar euroelessar force-pushed the ruslan/app-server-unix-socket branch from 5aec8a7 to 8c9337e Compare April 23, 2026 00:33
@bolinfest bolinfest self-requested a review April 23, 2026 00:34
Stdio,
WebSocket { bind_address: SocketAddr },
UnixSocket {
socket_path: Option<AbsolutePathBuf>,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would say this should be defined at construction so that the user of AppServerTransport never needs a reference to $CODEX_HOME.

Suggested change
socket_path: Option<AbsolutePathBuf>,
socket_path: AbsolutePathBuf,

Comment thread codex-rs/cli/src/main.rs Outdated
app_server_from_args(["codex", "app-server", "--listen", "unix://"].as_ref());
assert_eq!(
app_server.listen,
codex_app_server::AppServerTransport::UnixSocket { socket_path: None }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The only time you are constructing with None is in a test, anyway?

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.

we're also constructing it while parsing --listen flag, at which point we don't have the config yet, so can't materialize the path

}
}

#[cfg(test)]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prefer unix_socket_tests.rs with the path= thing. I need to codemod the rest of the repo so it looks like codex-core.

Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

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

Just some small things: nice job with the tests!

@euroelessar euroelessar merged commit 8a0ab3f into main Apr 23, 2026
25 checks passed
@euroelessar euroelessar deleted the ruslan/app-server-unix-socket branch April 23, 2026 18:09
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 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.

3 participants