Codex CLI (0.147.0, feature-flagged responses_websockets[_v2]) dials
GET <base>/responses over WS in prefix mode: /bili/<upstream>/responses,
conversation header session-id, one text frame per Responses event, full
history replay every turn (previous_response_id is never sent), and a
prewarm probe (input:[], generate:false) per connection.
- ws-bridge: pluginMarker is now optional (prefix-lane codecs admit on
loopback + conversation header + tunnel-guarded upstream, same trust
level as prefix-mode HTTP); conversationHeader selects the client's
session header; the claiming codec rides in WsBridgeContext for
per-protocol transport policy (allowStreamFlag).
- responses-ws: probe frames bypass the ACP pipeline and relay verbatim
(empty input would be normalized into a phantom turn by #1862 rules and
tool/philosophy injection is pure byte inflation on a no-generation
request); stream:true accepted when the codec opts in (codex always
sends it; opencode keeps the strict absent-flag policy).
- tests/codex-responses-ws.test.ts: probe+turn pipeline ride, full-replay
semantics, fold across a covered range, admission denials, non-stream
protocol error.
- src/ws-bridge.ts: protocol-independent shell (admission, upgrade, labeled
logging, exactly-once shutdown teardown) driven by a codec table
- src/responses-ws.ts: Responses-specific handling becomes responsesCodec
(WsBridgeCodec/WsBridgeSession contract)
- src/server.ts: single wiring site installWebSocketBridge(server, dispatch,
log, [responsesCodec]); unclaimed upgrades keep the existing 426
- tests/ws-bridge.test.ts: drives the shell with a synthetic second codec to
pin the codec-table abstraction
- docs: architecture section covering the shell/codec split; new protocols
are a codec file plus one table entry; unknown protocols stay on #1472