Summary
Evaluate and (if worthwhile) implement speculative prewarm (generate:false) on the Codex WebSocket transport — opening/priming the socket and server-side context before the first real turn, to shave first-token latency. Currently explicitly out of scope.
Why
Real Codex uses a generate:false prewarm to keep a connection warm and the context primed so the first billable turn starts faster. shunt already pools connections per session, so the remaining latency is the handshake + initial context upload on the first turn of a conversation. Prewarm targets exactly that. This is a pure latency optimization — no correctness impact — so it's lower priority than the correctness/robustness WS items, and should follow the live-probe work (so we trust continuation before adding speculative turns).
See docs/comparison.md §6 item D.
Tasks
Evidence
docs/m7-codex-websocket.md:53-58 (prewarm listed as out of scope)
src/adapters/codex_ws.rs (pooling, response.create framing)
Related
- Comparison:
docs/comparison.md
- Prerequisite: live-probe the continuation normalization first
Summary
Evaluate and (if worthwhile) implement speculative prewarm (
generate:false) on the Codex WebSocket transport — opening/priming the socket and server-side context before the first real turn, to shave first-token latency. Currently explicitly out of scope.Why
Real Codex uses a
generate:falseprewarm to keep a connection warm and the context primed so the first billable turn starts faster. shunt already pools connections per session, so the remaining latency is the handshake + initial context upload on the first turn of a conversation. Prewarm targets exactly that. This is a pure latency optimization — no correctness impact — so it's lower priority than the correctness/robustness WS items, and should follow the live-probe work (so we trust continuation before adding speculative turns).See
docs/comparison.md§6 item D.Tasks
generate:falseframe semantics against real Codex WS traffic (what it returns, whether it establishes a reusableprevious_response_id)./v1/messagesfor a new session id? (avoid prewarming sessions that never send a turn).websocketopt-in (and possibly a separateprewarmflag); keep it inert on non-Codex backends.Evidence
docs/m7-codex-websocket.md:53-58(prewarm listed as out of scope)src/adapters/codex_ws.rs(pooling,response.createframing)Related
docs/comparison.md