github / github/copilot-cli

Show per-subagent AI credit usage breakdown in /usage

未关闭
#4,207 0 条评论 8 个 reaction 已指派 0 人 在 GitHub 查看
area:agents
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

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

Copilot CLI displays cumulative AI-credit usage for the session, including 4 usage by the main agent, subagents, and background operations. However, it 5 does not show how those credits are distributed among individual agent 6 invocations. 7   8 This makes it difficult to identify expensive agents, compare custom-agent 9 models, and optimize multi-agent workflows.

### Proposed solution

Extend `/usage` with an optional itemized breakdown showing:

- Main-agent usage
- Each subagent invocation
- Custom-agent name
- Model used
- AI credits consumed
- Background operations such as context compaction
- Total session usage

### Example prompts or workflows

### Use case

When a parent agent delegates investigation, implementation, review, and
testing to several subagents, users need to understand which invocation or
configured model accounts for most of the session cost.

### Example

```
Main agent 4.20 AIC
Explore #1 — architecture 1.15 AIC
ios-implementer #1 7.80 AIC
Task #1 — tests 0.65 AIC
Context compaction 0.30 AIC
--------------------------------------------
Session total 14.10 AIC
```

Possible commands:

`/usage`
`/usage --by-agent`
`/usage --detailed`

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

从 /usage 命令和 issue 中描述的现有会话 credit 统计开始。追踪 main-agent、subagent、custom-agent、model 和 background-operation 的使用情况是如何记录的,然后定义针对所提议命令形式所显示的明细和总计。完成标准是 /usage 可以显示每次调用的详细信息,同时保留会话累计总计。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。