extensions are not loaded when using --autopilot flag
Describe the bug
I use extensions to enforce guard-rails and auto approve specific commands, this works fine when running copilot interactive, though when I try to use it with the autopilot flag these extensions don't get loaded, hence falling back to raw bash calls that get blocked by Permission denied and could not request permission from user unless running with --yolo flag....
Affected version
GitHub Copilot CLI 1.0.40
Steps to reproduce the behavior
- copilot -p "say hi" → log shows 0 Launching extension: entries
- copilot --autopilot -p "say hi" → 0 entries
- copilot --autopilot -i "
" (TTY) → 0 entries in our run; the model immediately starts producing bash calls that get denied
a plain interactive copilot (no inline prompt) loads all 6 of our extensions reliably.
Expected behavior
When starting copilot --autopilot -i "
Additional context
Root cause (best guess from reading the bundled app.js)
- Project extensions are loaded inside a useEffect gated on Xm===1 (folder trust state), via loadDeferredRepoHooks.
- The initial-prompt auto-submit useEffect is also gated on Xm===1, and seems to win the race in --autopilot -i mode.
- The non-interactive -p entry (xWo) calls registerSession(..., {trusted:false}) which short-circuits extension loading entirely, regardless of trustedFolders.
Requested fix
- Await extension/hook registration before submitting any user-supplied initial prompt in -i "
" and --autopilot -i " " mode. - Allow project extensions to load in non-interactive mode (-p) when the cwd is in trustedFolders (or behind a flag like --enable-extensions). Today they are unconditionally disabled.
This should be resolved as of v1.0.41. Extensions now load in prompt mode (-p); user extensions load by default, and project extensions can be enabled via GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS=true. If you believe this isn't resolved on the latest version, please comment with details and we'll take another look.