Repository navigation
fix(guard): accept per-connection session-id UUIDs in the cache relay (Codex 0.157+ WebSocket probes) - #22
Merged
Conversation
Codex 0.157+ sends its own per-connection UUID in the session-id header for WebSocket responses requests, which the relay's [thread-id, sessionId] check rejects; every probe handshake is destroyed and the client reports "Handshake not finished". Authorization stays anchored on the authorized disposable thread id (and the upstream leg rewrites session-id anyway). Tests: a per-connection UUID is now accepted and still rewritten upstream; non-UUID session-id values remain rejected.
Owner
|
Thanks for the contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Codex CLI 0.157.1, guard probes always fail (
fork_probe_failed,stage=inference). The 0.157 client uses the WebSocket responses transport and sends an independent per-connection UUID in thesession-idheader, so the cache relay's[thread-id, sessionId].includes(session-id)validation rejects every handshake; the socket is destroyed and the client reports "Handshake not finished". Full logs, evidence and environment are in #21.Changes
scripts/cache-transport.mjs: accept any UUID in the incomingsession-idheader. The request is still authorized byallowed.has(thread-id)plus theauthorizationheader, and the upstream leg rewritessession-idto the source cache session regardless of the incoming value.tests/cache-transport.test.mjs:session-id(instead of a random UUID),session-idand the disposablethread-id.Verification
node --test tests/*.test.mjs→ 171/171 pass on this branch.0.1.7:doctor --fork true→ready: true; probes complete (status=compatible, accepted samples withexpected == reported, aggregate counts 327/327 and 293/293,countMatched: true); fork snapshot and cleanup normal.Fixes #21.