Skip to content

extensions are not loaded when using --autopilot flag #3124

@udr013

Description

@udr013

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

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 "" it should load the extensions in .github/extensions/

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

  1. Await extension/hook registration before submitting any user-supplied initial prompt in -i "" and --autopilot -i "" mode.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automationarea:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions