Skip to content

fix(gateway): clear queued reload skills notes on new/resume/branch#19372

Closed
molvikar wants to merge 1 commit into
NousResearch:mainfrom
molvikar:fix/gateway-reload-skills-boundary-cleanup
Closed

fix(gateway): clear queued reload skills notes on new/resume/branch#19372
molvikar wants to merge 1 commit into
NousResearch:mainfrom
molvikar:fix/gateway-reload-skills-boundary-cleanup

Conversation

@molvikar
Copy link
Copy Markdown
Contributor

@molvikar molvikar commented May 3, 2026

Summary

This fixes a stale gateway state leak where the one-shot note queued by /reload-skills
could 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 normally
consumed on the next user turn. Before this change, session-boundary flows like /new,
/resume, and /branch cleared approval/update state but did not clear the pending
reload-skills note.

What changed

  • Clear _pending_skills_reload_notes[session_key] inside
    GatewayRunner._clear_session_boundary_security_state()
  • Extend gateway boundary regression tests to verify that /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.py

  • tests/gateway/test_reload_skills_command.py

  • Result: 9 passed

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery tool/skills Skills system (list, view, manage) labels May 3, 2026
@teknium1
Copy link
Copy Markdown
Contributor

teknium1 commented May 4, 2026

Salvaged via #19431 onto current main — your commit's authorship was preserved. Thanks @molvikar!

@teknium1 teknium1 closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants