fix(gsd): handle session_switch event so /resume restores GSD state (#2587)
The GSD extension only listened for session_start, not session_switch. When /resume switched to a previous session, GSD's write-gate, loop guard, discussion flow, service tier, and tool API keys were never re-initialized, leaving GSD in stale state from the prior session. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7cf4084a1e
commit
e1f51592b1
2 changed files with 9 additions and 1 deletions
|
|
@ -69,6 +69,14 @@ export function registerHooks(pi: ExtensionAPI): void {
|
|||
}
|
||||
});
|
||||
|
||||
pi.on("session_switch", async (_event, ctx) => {
|
||||
resetWriteGateState();
|
||||
resetToolCallLoopGuard();
|
||||
clearDiscussionFlowState();
|
||||
await syncServiceTierStatus(ctx);
|
||||
loadToolApiKeys();
|
||||
});
|
||||
|
||||
pi.on("before_agent_start", async (event, ctx: ExtensionContext) => {
|
||||
return buildBeforeAgentStartResult(event, ctx);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
"gsd_requirement_update", "gsd_milestone_generate_id"
|
||||
],
|
||||
"commands": ["gsd", "kill", "worktree", "exit"],
|
||||
"hooks": ["session_start"],
|
||||
"hooks": ["session_start", "session_switch"],
|
||||
"shortcuts": ["Ctrl+Alt+G"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue