github / github/copilot-cli

Collapsible live tool usage panel — MCP servers, built-in tools, and native functions call stats

Đang mở
#1,788 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:mcp
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ả

### Describe the feature or problem you'd like to solve

During a session the agent invokes a wide variety of tools — MCP server tools, built-in tools (shell, file read/write, grep, glob), sub-agent launchers, and native functions — but there is no consolidated view of which tools have been called, how often, whether any failed, or how long they took. This information is buried in the scrollback or log files. For users debugging agent behaviour, optimising tool usage, or monitoring costs, a live at-a-glance tool usage panel would be invaluable.

### Proposed solution

Add an optional **Tool Usage panel** — collapsible/expandable, opt-in via config — that shows a live, categorised summary of all tool invocations for the current session.

**Folded (compact):**
```
🔧 Tools [24 calls · 1 error · 3 MCP · 8 built-in · 2 native]
```

**Unfolded (expanded, grouped by category):**
```
🔧 Tool Usage

MCP Servers
playwright 4 calls ✔ 4 ✖ 0 avg 1.2s
memory 2 calls ✔ 2 ✖ 0 avg 0.1s
git 3 calls ✔ 2 ✖ 1 avg 0.8s ⚠ 1 error

Built-in Tools
powershell 6 calls ✔ 6 ✖ 0 avg 3.4s
grep 4 calls ✔ 4 ✖ 0 avg 0.2s
glob 2 calls ✔ 2 ✖ 0 avg 0.1s
view 3 calls ✔ 3 ✖ 0 avg 0.1s

Sub-agents
explore 2 calls ✔ 2 ✖ 0 avg 8.1s
task 1 call ✔ 1 ✖ 0 avg 22.3s

Native / Functions
lsp 2 calls ✔ 2 ✖ 0 avg 0.4s
```

Each row shows: **call count**, **success/failure counts**, and **average duration**. Rows with errors are highlighted. The panel updates live as tools are invoked.

**Controls:**
- Toggle fold/unfold: dedicated key (e.g. `Ctrl+T`) or clickable header
- Opt-in via `config.json`:
```json
{ "toolPanel": true }
```
- Disabled by default — clean UI for new users, visible for power users who enable it.
- Companion to the Session Stats panel (#1784) — together they give a full resource and activity picture.

### Example prompts or workflows

1. Agent repeatedly fails on a `git` MCP tool — user spots `⚠ 1 error` in the folded line without waiting for the agent to surface it.
2. User notices `powershell` has been called 18 times in one turn — a signal the agent may be in a loop, prompting early intervention.
3. Developer building a custom MCP server verifies their tool is being invoked the expected number of times and with the expected latency.
4. User monitoring plan usage sees that `explore` sub-agents have been launched 6 times and adjusts their prompt strategy to consolidate searches.
5. User keeps the panel folded — the one-line badge gives just enough signal (`24 calls · 1 error`) to catch problems without cluttering the screen.

### Additional context

- OS: Windows 11 Pro (Build 26200 / 24H2)
- Shell: PowerShell 7.5.4
- Copilot CLI: 0.0.420 (win32-x64)
- Closely related to the Session Stats panel (#1784) and Worker Agents panel (#1783) — all three form a coherent optional monitoring layer for power users.
- Tool invocation data is already present in session logs (`--log-level`) — this panel surfaces it live in the TUI without requiring log parsing.
- Error highlighting should use the same colour conventions as the rest of the TUI (red for failures, yellow for warnings).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.