Describe the bug
When a session is resumed using --resume, hooks configured in .github/hooks/*.json are never loaded.
In the source code (index.js v0.0.411-1), createSession() calls loadHooks() to discover and register hook files from .github/hooks/. However, getSession() — which handles the --resume code path — does not call loadHooks(). This means any tool or wrapper that uses --resume will never trigger any configured hooks (sessionEnd, agentStop, etc.).
Affected version
GitHub Copilot CLI 0.0.411-1 (Windows_NT)
Steps to reproduce the behavior
- Install a hook via a
.github/hooks/*.json file (e.g. toasty --install copilot creates ~/.github/hooks/toasty.json with a sessionEnd hook).
- Start Copilot CLI with
--resume <sessionId>.
- Complete a session or trigger the hook event.
- Observe that the hook command is never executed.
Without --resume (fresh createSession path), the same hook file works correctly.
Expected behavior
getSession() should call loadHooks() (or equivalent) so that hooks from .github/hooks/*.json are loaded for resumed sessions, just as they are for new sessions.
Additional context
- Impact: Any wrapper that always passes
--resume (e.g. Agency / Microsoft Agent Platform) will never fire hooks. This completely breaks the hooks feature for those users.
- Root cause location: In the minified
index.js, createSession contains a call to this.loadHooks(e) while getSession has zero references to loadHooks, hooks, or the hook-loading helpers (B3t, Tee).
- Hook file format is correct: The
.github/hooks/toasty.json file validates against the zod schema (version: 1, hooks.sessionEnd array with type: "command", powershell/bash fields, timeoutSec).
- Hook file location is correct: Copilot CLI globs
<gitRoot>/.github/hooks/**/*.json (or <cwd>/.github/hooks/ if not in a git repo). The file is at ~/.github/hooks/toasty.json.
- Verified across 5 Agency sessions that
--resume is always passed, confirming hooks never load.
Describe the bug
When a session is resumed using
--resume, hooks configured in.github/hooks/*.jsonare never loaded.In the source code (
index.jsv0.0.411-1),createSession()callsloadHooks()to discover and register hook files from.github/hooks/. However,getSession()— which handles the--resumecode path — does not callloadHooks(). This means any tool or wrapper that uses--resumewill never trigger any configured hooks (sessionEnd,agentStop, etc.).Affected version
GitHub Copilot CLI 0.0.411-1 (Windows_NT)
Steps to reproduce the behavior
.github/hooks/*.jsonfile (e.g.toasty --install copilotcreates~/.github/hooks/toasty.jsonwith asessionEndhook).--resume <sessionId>.Without
--resume(freshcreateSessionpath), the same hook file works correctly.Expected behavior
getSession()should callloadHooks()(or equivalent) so that hooks from.github/hooks/*.jsonare loaded for resumed sessions, just as they are for new sessions.Additional context
--resume(e.g. Agency / Microsoft Agent Platform) will never fire hooks. This completely breaks the hooks feature for those users.index.js,createSessioncontains a call tothis.loadHooks(e)whilegetSessionhas zero references toloadHooks,hooks, or the hook-loading helpers (B3t,Tee)..github/hooks/toasty.jsonfile validates against the zod schema (version: 1,hooks.sessionEndarray withtype: "command",powershell/bashfields,timeoutSec).<gitRoot>/.github/hooks/**/*.json(or<cwd>/.github/hooks/if not in a git repo). The file is at~/.github/hooks/toasty.json.--resumeis always passed, confirming hooks never load.