Supersede stuck Codex WebSocket responses #26

targeting main from deleted fork:fix/codex-busy-supersede
Merged opened by and assigned to callie.on-her.computer
targeting main from deleted fork:fix/codex-busy-supersede

Replace the bridge-generated conversation-busy 409 with latest-request-wins handling for persistent Codex WebSockets.

A new request for the same conversation closes and replaces an in-flight socket. It preserves only the last completed same-credential continuation, never carries response state or telemetry identity across credentials, and prevents the superseded request from replaying through the HTTP fallback.

Adds regression coverage for supersession after partial output, supersession before output, continuation replay, and downstream cancellation.

Verification:

  • npm run format:check
  • npm run typecheck
  • node --import tsx --test src/codex-websocket.test.ts (17/17)
  • npm test: build passed and 247 tests passed; two pre-existing src/upstream-errors.test.ts tests were cancelled identically on untouched origin/main
Commits 0