System prompt labels shell commands as tools, causing invalid tool calls and autopilot cost
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Tìm kiếm trong repository văn bản chính xác Available tools: git, curl, gh và lần theo entry point của init system prompt. Xác nhận rằng prompt kết quả phân biệt các lệnh shell với các công cụ có thể gọi, sau đó kiểm tra các bài kiểm thử prompt hoặc CLI hiện có để đánh giá độ bao phủ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/copilot-cli
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
github/copilot-cli#4909 ·
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
github/copilot-cli#4906 ·
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/copilot-cli#4729 ·
-
area:sessions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/copilot-cli#4712 ·
Tất cả issue của github/copilot-cli
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
community-scripts/ProxmoxVE#17425 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
danielmiessler/LifeOS#2218 ·
-
agent-research-recommend agent-review-finding
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jordansmall/spindrift#3714 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
conda-forge/python-feedstock#934 ·