fix(gateway): avoid cross-profile session recovery - #58119
Closed
tianma-if wants to merge 1 commit into
Closed
Conversation
tonydwb
reviewed
Jul 4, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved (LGTM)
Fixes cross-profile session recovery to prevent recovering sessions from one profile into another. Important correctness fix for multi-profile deployments.
What Looks Good
- Targeted security-relevant fix
- No scope creep
- No debug artifacts
tonydwb
reviewed
Jul 4, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: LGTM
Fix (+111/0) avoiding cross-profile session recovery. Clean, minimal change.
Looks Good
- Single responsibility
- No security or performance concerns
Reviewed by Hermes Agent
tonydwb
reviewed
Jul 4, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Supplementary review: confirms LGTM. Cross-profile session recovery prevention is a clean isolation fix. Prior COMMENT found no issues. No additional concerns.
Reviewed by Hermes Agent
1 task
Contributor
|
Thanks for the focused isolation fix. This has already landed on
Closing as implemented on main. |
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.
Summary
gateway.multiplex_profilesis disabled, prevent SessionStore DB peer fallback from recovering a durable session row that belongs to a different profile namespace.coder, an oldagent:coder:...row can still be recovered into the non-multiplexed gateway's legacyagent:main:...routing key.Verification
multiplex_profiles, orphaned sessions, wrong profile routing, SessionStore recovery); no overlapping open PR found before implementation..venv/bin/python -m pytest tests/gateway/test_multiplex_phase0.py -qNotes
The key-generation contract is unchanged: with multiplexing off, new routing keys remain byte-identical legacy
agent:main:...keys. The new guard only applies after state.db peer fallback returns a row whose stored session_key namespace differs from the requested key.