github / github/copilot-cli

🐛 Repo `.claude/agents/*/AGENT.md` `model:` field overrides session model for Copilot custom agents, breaking subagent spawns on BYOK providers

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

Nadie ha tomado este issue todavía.

area:agents area:models
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

When a repository ships a Claude-Code agent definition in .claude/agents/<name>/AGENT.md with a model: field, the GitHub Copilot CLI honors that model: value as the default model for the Copilot custom agent of the same name — even when the agent is launched from .github/agents/<name>.md and even when the session runs on a different model.

On a BYOK provider (e.g. Ollama) where that model (sonnet, opus, …) is not served, spawning the agent as a task-tool subagent silently fails: the orchestrator reports Agent completed but produced no response. (or a Model '...' not found on provider ... (HTTP 404)), with no error surfaced to the caller.

Repro

  1. Session started with COPILOT_MODEL=deepseek-v4-flash:cloud (Ollama BYOK) and --model deepseek-v4-flash:cloud.
  2. Repo contains:
    • .github/agents/developer.md — a Copilot custom agent (no model: field).
    • .claude/agents/developer/AGENT.md — a Claude-Code agent with model: sonnet.
  3. Orchestrator (agent_type: test-orch, tool task) spawns task(agent_type: developer, mode: sync, ...).

Result: subagent fails / displays as Developer(sonnet), no response. Removing the model: sonnet line from .claude/agents/developer/AGENT.md, or moving the agent to user scope ~/.copilot/agents/, makes it inherit the session model and work.

Evidence (local bisect)

  • With .claude/agents/developer/AGENT.md (model: sonnet) present → Developer(sonnet), subagent fails.
  • Removing only the model: sonnet line → Developer(deepseek-v4-flash:cloud), subagent works.
  • Removing the whole .claude/agents/ dir → same fix.
  • User-level .copilot/agents/developer.md (no .claude counterpart, no model:) → inherits session model, works.
  • Passing model: deepseek-v4-flash:cloud explicitly to the task tool → overrides the .claude model, works.

The changelog confirms repo-level .claude/agents are intentionally discovered as custom agents, but honoring their Claude-specific model: hint for Copilot agents appears unintended and is the trigger.

Expected behaviour

Option A: .claude/agents/*/AGENT.md model: is treated as a Claude-Code-only hint and is ignored by the Copilot CLI (agents inherit the session model like .github/agents/*.md do).

Option B: a configuration flag/setting to ignore .claude models or force session-model inheritance for subagents.

Environment

  • Copilot CLI 1.0.79, macOS.
  • Provider: Ollama BYOK via COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_WIRE_API=responses, COPILOT_MODEL.

Related

  • #3266 (background task agents silently substitute requested model)
  • #2758 (opt-out for the cost-multiplier guard that clamps subagent model to session model)

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

Empieza rastreando cómo se descubre repo-level .claude/agents/*/AGENT.md y cómo se asigna su campo model a Copilot custom agents; compáralo con .github/agents/developer.md y ~/.copilot/agents/developer.md. Reprodúcelo con Ollama BYOK y task(agent_type: developer), y luego verifica que el subagente hereda el modelo de la sesión y devuelve una respuesta cuando el modelo de Claude no está disponible.

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

Evaluación

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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.