fix(gateway): clear queued reload skills notes on new/resume/branch#19372
Closed
molvikar wants to merge 1 commit into
Closed
fix(gateway): clear queued reload skills notes on new/resume/branch#19372molvikar wants to merge 1 commit into
molvikar wants to merge 1 commit into
Conversation
Contributor
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
This fixes a stale gateway state leak where the one-shot note queued by
/reload-skillscould survive a session boundary and get prepended to the next message in a different
conversation branch.
The queued note lives in
self._pending_skills_reload_notes[session_key]and is normallyconsumed on the next user turn. Before this change, session-boundary flows like
/new,/resume, and/branchcleared approval/update state but did not clear the pendingreload-skills note.
What changed
_pending_skills_reload_notes[session_key]insideGatewayRunner._clear_session_boundary_security_state()/resume,/branch,and the shared cleanup helper remove the queued note only for the target session
Why this matters
Without this fix, a user could run
/reload-skills, then switch/reset/branch the session,and see the old reload note injected into the first message of the new session context.
That is a small but real session-boundary state leak.
Tests
Passed:
tests/gateway/test_session_boundary_security_state.pytests/gateway/test_reload_skills_command.pyResult:
9 passed