mirror of
https://github.com/openai/codex.git
synced 2026-09-09 15:58:47 +00:00
Motivation: Concurrent initialized request handling lets later RPCs for the same high-level object run before earlier RPCs publish their side effects. A bare per-key mutex would not guarantee arrival order once tasks are spawned, so same-key requests need an explicit FIFO queue. Summary: Add Rust-only serialization metadata to client_request_definitions!, expose ClientRequest::serialization_scope(), and implement a private app-server per-key FIFO dispatcher. The server maps logical protocol scopes to runtime queue keys, including connection-scoped command/exec process IDs and fs watch IDs, while leaving unkeyed requests concurrent. Testing: - cargo test -p codex-app-server-protocol client_request_serialization_scope - cargo test -p codex-app-server request_serialization --lib - cargo test -p codex-app-server-protocol - cargo test -p codex-app-server