Repository navigation
fix(codex): preserve historical session peer during startup sweep - #6406
Merged
t0saki merged 1 commit intoNov 13, 2026
Merged
Conversation
fancyboi999
force-pushed
the
fix/6402-unscoped-session-peer
branch
from
November 6, 2026 01:27
72feec8 to
2283b02
Compare
t0saki
approved these changes
Nov 13, 2026
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.
Description
Starting Codex in project B can assign uncaptured turns from an older, unscoped session to B during the startup sweep. The batch payload falls back from the historical session's empty
workspacePeerIdto the new session'sactivePeerId. The shared HTTP client also sends B's actor-peer header when sweeping a session pinned to project A.Bind catch-up and commit requests to the historical session's persisted peer, including an empty user-level pin. Persist explicit peers at SessionStart as well as derived workspace peers, so a later sweep has the identity used by the session. Current-session profile injection continues to use the current peer.
Human Involvement
Related Issue
Fixes #6402.
Related prior work: #3620 was closed without merging. #5755 addresses the startup state writer's locking, separately from this routing defect.
Type of Change
Changes Made
Testing (Original Implementation)
Commands and results:
node:24-slimcontainer, fromexamples/codex-memory-plugin:node --test scripts/*.test.mjs servers/*.test.mjs— 206 passed, 0 failed, 0 skipped.node --test examples/memory-plugin-shared/sync.test.mjs examples/memory-plugin-shared/ov-http.test.mjs examples/memory-plugin-shared/batch-send.test.mjs examples/memory-plugin-shared/workspace-peer.test.mjs— 62 passed, 0 failed, 0 skipped.node examples/memory-plugin-shared/sync.mjs— no additional tracked changes.git diff --checkandbash .github/scripts/check-plugin-version-bumps.sh origin/mainpassed.f8d36722ab4caa38e482210e8d98ec802536901c: 1 passed, 3 failed. All four pass with this change.The native-service test disabled extraction and working memory, used a loopback synthetic embedding provider, and made zero LLM requests. It verifies capture, commit, persisted attribution, and restart durability; it does not measure extraction quality or recall ranking. The server emitted an existing optional
python-ldapwarning; LDAP was not exercised. Windows was not tested.Conflict Resolution Verification (2026-10-28)
Merged upstream
mainata8e334c31c9df168983e6bd72422a3c8431715b3into this branch. The only textual conflict was the plugin manifest version; it is now0.11.18(upstream:0.11.17). The session routing implementation and HTTP regression tests merged without conflicts.Current verification on macOS, Node 24.22.1:
git diff --checkpassed.The native-service durability checks documented above belong to the original implementation and were not repeated for this manifest conflict resolution. Windows was not tested.
Checklist
Documentation is unchanged: the documented user-level behavior outside repositories and project-peer behavior are being restored. There are no prerequisite PRs.
Screenshots (if applicable)
N/A — lifecycle hook and HTTP API behavior.
Additional Notes
The fallback used by catch-up was introduced with #4429. This change retains its lock, unreadable-transcript, incomplete-batch, cursor-retention, and commit-retry behavior. Existing tests for those paths pass.
No state schema or peer-pin-version change is needed. A pin already cleared by the existing legacy migration stays empty; historical identity cannot safely be reconstructed from the newly opened workspace. This fix prevents future misattribution and does not rewrite existing archives. Actor-peer provenance is within the same account/user namespace; this is not a cross-tenant authorization claim.