fix(codex): preserve websocket continuity across executor refresh#4569
fix(codex): preserve websocket continuity across executor refresh#4569yinkev wants to merge 1 commit into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87336d0b96
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
87336d0 to
95ef390
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95ef3909f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
95ef390 to
d801802
Compare
d801802 to
b554eb9
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Root cause
Starting with v7.2.96, replacing a Codex executor closed every session in the shared WebSocket store. A follow-up request carrying
previous_response_idthen opened a different upstream socket, where the response ID did not exist.The old and replacement
CodexAutoExecutorinstances intentionally share the global session store. This patch hands sessions across replacement only when their connection identity is compatible.Connection compatibility
The per-session connection key includes:
identity-confusemodeProvider-level handoff compares only settings that affect every Codex socket. Rotating an unrelated configured API key no longer closes OAuth sessions. Rotating the API key actually used by a session still changes its per-session connection key and reconnects.
Ordinary OAuth access-token rotation preserves an established socket.
Validation
go test ./internal/runtime/executor ./sdk/cliproxy/auth -count=1go vet ./internal/runtime/executor ./sdk/cliproxy/authgo build -o /tmp/pr4569-server ./cmd/servergit diff --check upstream/dev...HEADFixes #4524