github / github/copilot-cli

[Bug] Interactive mode activates 0 plugin custom agents while --prompt activates 4

Abierto
#4,592 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

area:agents area:plugins
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

Describe the bug

Copilot CLI interactive mode discovers installed plugins but activates zero plugin-contributed custom agents. The same installation and working directory successfully activate four custom agents in non-interactive --prompt mode.

When started interactively with a selected plugin agent, the UI briefly shows the selected agent, then clears it and reports:

Custom agent "<plugin>:<agent>" not found. Available agents: none

/agent then displays:

No custom agents found in this workspace yet.

The session continues as the default agent.

This has a secondary MCP impact: because the selected agent never loads, its mcp-servers: scoping block never applies. All user-global MCP servers start instead of the two bundled by the agent. In the reproduced environment this changed startup from 2 scoped servers to 20 enabled servers, producing authentication prompts and unrelated server failures.

Affected version

Reproduced on:

  • 1.0.81-6
  • 1.0.81-7
  • 1.0.81-8
  • 1.0.81-9

Primary evidence below is from 1.0.81-9 on Windows 11, x86_64, Windows Terminal, PowerShell 7.

Steps to reproduce the behavior

  1. Install or load a Copilot CLI plugin that contributes a custom agent.

  2. Confirm the agent works in prompt mode:

    copilot --allow-all --agent <plugin>:<agent> --model claude-opus-5 --prompt "Reply OK"
    
  3. Start the same agent interactively from the same working directory:

    copilot --allow-all --agent <plugin>:<agent> --model claude-opus-5
    
  4. Observe that the agent is initially shown as selected, then clears within about one second.

  5. Run /agent. It reports no custom agents.

  6. Run /mcp. User-global MCP servers are active rather than the selected agent's scoped MCP bundle.

Deterministic A/B from debug logs

Successful non-interactive process:

20:09:45.892 [INFO] Starting Copilot CLI: 1.0.81-9
20:09:46.658 [DEBUG] Plugin activation [agents]: ... plugins=6, loaded=4

Failed interactive process:

20:15:53.416 [INFO] Starting Copilot CLI: 1.0.81-9
20:15:53.628 [DEBUG] ... cli_ready
20:15:53.633 [INFO] Login status unknown
20:15:53.827 [DEBUG] Plugin activation [agents]: ... plugins=6, loaded=0

The interactive process declares ready and activates agents about 0.4 seconds after process start. The prompt process activates agents about 0.8 seconds after process start and loads all four.

Repeated interactive launches consistently produced:

Plugin activation [agents]: ... plugins=6, loaded=0

Repeated --prompt launches consistently produced:

Plugin activation [agents]: ... plugins=6, loaded=4

Expected behavior

Interactive and --prompt modes should activate the same installed plugin custom agents. --agent <plugin>:<agent> should remain selected in interactive mode, and the agent's mcp-servers: scoping should apply before MCP startup.

If agent activation must wait for model/backend initialization, interactive mode should delay activation or retry after initialization rather than permanently caching an empty agent list.

Additional context

The following variables were tested and did not change interactive loaded=0:

  • Trusted versus untrusted working directory
  • Main repository versus linked Git worktree
  • Existing credential versus copilot login --with-token refresh
  • COPILOT_GITHUB_TOKEN present before child-process launch
  • --plugin-dir <plugin-root>
  • Repository-local .github/agents/<agent>.agent.md
  • --add-dir <repository>
  • Removing the enabledPlugins setting
  • CLI versions 1.0.81-6 through 1.0.81-9

A repository-local agent and --add-dir still hit the same early log line and then loaded no agents:

No model backend (auth, legacy provider, or BYOK registry) available, skipping custom agents load
Plugin activation [agents]: ... plugins=6, loaded=0

Refreshing the supported Copilot credential succeeded:

Signed in successfully as <user>

but the next interactive launch still emitted Login status unknown and loaded=0.

This does not appear to be the filename/frontmatter mismatch described in #2475. In this case the filename and frontmatter name match, and /agent lists zero custom agents rather than retaining filename-based entries.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza rastreando las rutas de inicio interactiva y --prompt alrededor del mensaje registrado “No model backend...” y de las entradas “Plugin activation [agents]”, comparando cuándo se cargan los agentes personalizados. Se considera terminado cuando ambos modos activan los mismos agentes instalados, conservan la selección de --agent y aplican el alcance de MCP del agente seleccionado antes del inicio de MCP.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
shell
Área
cli
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.