Tool/function calls intermittently emit malformed invocation markup (court / <invoke>) and silently no-op
Chưa có ai nhận issue này.
- 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
Mô tả
This issue was generated by the GitHub Copilot CLI agent itself (Claude Opus 4.8), not written by a human. The human user may add further details later.
Environment
- Copilot CLI version: 1.0.82
- Model: Claude Opus 4.8 (claude-opus-4.8)
- OS: Windows
- Shell: PowerShell
Summary
During a long interactive session, a significant fraction of the agent's tool calls are emitted in a malformed format — the message contains a stray literal token (court) followed by <invoke name="..."> markup instead of a properly-formed function call. When this happens the tool does not execute; no command runs and no output is produced. Retrying the identical call usually succeeds on the 2nd–4th attempt.
Impact
- Frequent wasted turns: the user repeatedly has to prompt "your tool call failed / is malformed, redo it."
- Severe slowdown of multi-step workflows (e.g. git history surgery, build/test loops) where nearly every step needed 1–3 retries.
- Erodes trust; in this session the user considered the agent effectively broken.
Observed pattern
- Prevalence increases as the session/context grows large (this session was very long, with extensive tool use).
- Especially frequent on
powershelltool calls that use here-strings/multi-line scripts, though it also affects simple calls. - The malformed output looks like a leaked internal call wrapper rather than a valid tool invocation.
Expected
Every tool invocation is emitted in the correct function-call format and executes reliably, regardless of session length.
Actual
Calls intermittently render as literal court + <invoke …> text and are dropped (no execution, no error surfaced to the tool layer).
Workarounds tried
- Re-issuing the same call in the exact correct format (works, but only after failed attempts).
- Keeping call blocks minimal / avoiding here-strings reduces but does not eliminate it.
Notes
No custom tools involved in the failures; occurs with built-in powershell/git operations. Repro is nondeterministic but recurrent within a single long session.
Text below is added by @MortenBoysen, the human operator.
As an example of a session where this happens, below I have pasted in the part of the session where Copilot CLI had to submit this bug report:
Let me write the body to a temp file (avoids quoting issues), then create the issue with the bug label.
Create copilot-cli-bug.md +33
Shell Create the bug report issue with bug label 2 lines…
Set-Location C:\git\repo $body = "C:\Users\Morten Boysen\AppData\Local\Temp\copilot-cli-bug.md" gh issue create --repo github/copilot-cli --title…
Thought for 1s
The bug label doesn't exist there. Let me check what labels are available.
court
Set-Location C:\git\repo
gh label list --repo github/copilot-cli --limit 40 2>&1 | Select-Object -First 40
List available labels in target repo
> tool call failed again
court
Set-Location C:\git\repo
gh label list --repo github/copilot-cli --limit 40 2>&1 | Select-Object -First 40
List available labels in target repo
> tool call failed again
court
Set-Location C:\git\repo; gh label list --repo github/copilot-cli --limit 40 2>&1 | Select-Object -First 40
List available labels in target repo
> tool call failed again
$ Shell List available labels in target repo 31 lines…
Set-Location C:\git\repo; gh label list --repo github/copilot-cli --limit 40 2>&1 | Select-Object -First 40
Thought for 3s
No bug label exists. Best-matching labels are area:tools ("...tool call behavior") and area:context-memory (prevalence grows with context size). Submitting with those.
court
Set-Location C:\git\repo
$body = "C:\Users\Morten Boysen\AppData\Local\Temp\copilot-cli-bug.md"
gh issue create --repo github/copilot-cli --title "Tool/function calls intermittently emit malformed invocation markup (court / ) and silently no-op" --body-file $body --label "area:tools" --label "area:context-memory" 2>&1
Create the bug report with area labels
> tool call failed again
court
Set-Location C:\git\repo
$body = "C:\Users\Morten Boysen\AppData\Local\Temp\copilot-cli-bug.md"
gh issue create --repo github/copilot-cli --title "Tool/function calls intermittently emit malformed invocation markup (court / ) and silently no-op" --body-file $body --label "area:tools" --label "area:context-memory" 2>&1
Create the bug report with area labels
> tool call failed again
$ Shell Create the bug report with area labels 2 lines…
Set-Location C:\git\repo $body = "C:\Users\Morten Boysen\AppData\Local\Temp\copilot-cli-bug.md" gh issue create --repo github/copilot-cli --title…
Submitted successfully.
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.
Hướng nghiên cứu
Không có tệp mã nguồn hoặc bài kiểm thử nào được nêu tên. Hãy bắt đầu bằng cách tái hiện các lệnh gọi sai định dạng trong các đường dẫn công cụ tích hợp của PowerShell và git, so sánh các lệnh ngắn và nhiều dòng trong các phiên ngắn và dài. Hoàn tất khi định dạng function-call hợp lệ được phát ra một cách nhất quán, các lệnh được thực thi và các lỗi làm xuất hiện một lỗi thay vì âm thầm loại bỏ lệnh gọi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- git, powershell, shell
- Lĩnh vực
- cli, developer-experience, tooling
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100