System prompt labels shell commands as tools, causing invalid tool calls and autopilot cost
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
Línea de trabajo
Busca en el repositorio el texto exacto Available tools: git, curl, gh y sigue el punto de entrada del prompt del sistema de init. Confirma que el prompt resultante distingue los comandos de shell de las herramientas invocables y, a continuación, inspecciona las pruebas existentes de prompt o CLI para comprobar la cobertura.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
In Copilot CLI non-interactive/autopilot sessions, the init system prompt labels shell commands as "Available tools":
<environment_context>
...
* Available tools: git, curl, gh
</environment_context>
In the observed session, curl was available as a shell command, but not as a callable Copilot tool/function. The model treated it as a callable tool and emitted:
tool= curl args= {'url': 'https://app.notion.com/p/...'}
The runtime then returned:
Tool 'curl' does not exist.
This looks like prompt-surface ambiguity rather than only a model mistake: the system prompt uses the word "tools" for shell commands while callable tools are also exposed to the model as tools.
Related schema confusion observed in the same testing work
The same ambiguity showed up around other tool workflows:
- Shell/session tools were called without the required prior shell state:
Multiple validation errors:
- "shellId": Required
- "delay": Required
- Sub-agent/task invocation was attempted with an incomplete schema:
{name: "task", arguments: {agent_type: "translation-validator", description: "Validate changelog files", prompt: "...", mode: "background"}}
Runtime response:
"name": Required
The model then switched to background agent + read_agent, which worked but added extra turns and runtime cost.
Why this matters
Autopilot mode absorbs these validation errors and keeps going, but each invalid tool call costs extra model requests, tokens, and wall time. This is especially visible with smaller/local models that are more sensitive to tool-surface ambiguity.
In our prompt optimization test, making the prompt explicitly avoid the ambiguous paths removed the validation errors across 10/10 successful runs:
- Require direct file write, not shell input/bash write
- Require
translation-validatorwithname=translation-validator - Require synchronous validator, not background/read_agent
- Require validator to read only output files, not Notion/web/curl
- Use
events.jsonlsession.task_completeas completion signal, not stdout
Affected version
Observed in Copilot CLI session metadata:
copilotVersion: 1.0.39
model: Qwen3.6-35B-A3B-bf16
mode: --autopilot, non-interactive
Expected behavior
The init system prompt should clearly distinguish callable tools from shell commands. For example:
* Available shell commands: git, curl, gh
instead of:
* Available tools: git, curl, gh
It would also help if the tool guidance made preconditions and required fields harder to miss, especially for:
- shell/session output tools that require
shellId task/ sub-agent tools that requirename- background agent flows that require
read_agent
Suggested fixes
- Rename
Available tools: git, curl, ghtoAvailable shell commands: git, curl, ghin the system prompt. - Explicitly state that shell commands must be run through the bash/shell tool and are not callable tool names.
- Add stronger schema guidance for
task/ sub-agent invocation, including requirednameand when not to use background/read_agent. - Add stronger precondition wording for shell output/input tools that require an existing
shellId.
Additional context
This is related in impact to task completion/output reliability issues, but it is a distinct problem: tool-surface ambiguity in the init prompt causes invalid tool calls and unnecessary autopilot cost.
- Lenguaje dominante
- Shell
- Estrellas
- 11.2k
- Forks
- 1.9k
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 6
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/copilot-cli
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/copilot-cli#4729 ·
-
area:sessions
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/copilot-cli#4712 ·
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
github/copilot-cli#4638 ·
-
Expose large_output_file_path on TaskShellProgress so clients can read complete shell-task output Abiertoarea:tools
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
github/copilot-cli#4630 · 1 comentario ·
Todos los issues de github/copilot-cli
Issues similares
-
out-of-date
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
CachyOS/CachyOS-PKGBUILDS#1894 ·
-
[InvoiceShelf] No database info Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
community-scripts/ProxmoxVE#17396 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mattpocock/skills#1099 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
No-op if nothing loads zsh/zle Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100