mirror of
https://github.com/openai/codex.git
synced 2026-05-24 04:54:52 +00:00
## Summary - add a codex-uds crate with async UnixListener and UnixStream wrappers - expose helpers for private socket directory setup and stale socket path checks - migrate codex-stdio-to-uds onto codex-uds and Tokio-based stdio/socket relaying - update the CLI stdio-to-uds command path for the async runner ## Tests - cargo test -p codex-uds -p codex-stdio-to-uds - cargo test -p codex-cli - just fmt - just fix -p codex-uds - just fix -p codex-stdio-to-uds - just fix -p codex-cli - just bazel-lock-check - git diff --check
21 lines
529 B
Rust
21 lines
529 B
Rust
use std::env;
|
|
use std::path::PathBuf;
|
|
use std::process;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> anyhow::Result<()> {
|
|
let mut args = env::args_os().skip(1);
|
|
let Some(socket_path) = args.next() else {
|
|
eprintln!("Usage: codex-stdio-to-uds <socket-path>");
|
|
process::exit(1);
|
|
};
|
|
|
|
if args.next().is_some() {
|
|
eprintln!("Expected exactly one argument: <socket-path>");
|
|
process::exit(1);
|
|
}
|
|
|
|
let socket_path = PathBuf::from(socket_path);
|
|
codex_stdio_to_uds::run(&socket_path).await
|
|
}
|