Feature: surface ACP prompt-result usage (token counts) in the existing token usage UI
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 68/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust, typescript
调研方向
追踪 src/crates/interfaces/acp/src/client/stream.rs 和 manager.rs 中的 ACP prompt 响应,然后通过 src/web-ui/src/flow_chat/types/flow-chat.ts 和 src/web-ui/src/flow_chat/utils/tokenUsageDisplay.ts 跟踪现有的 token 流程。确认 ContextUsageUpdated 和 TokenUsage 目前是如何流转的。完成标准是:当响应提供 ACP 会话/prompt 使用量时,将其显示在现有的 token 使用量 UI 中,同时不破坏省略使用量的 agent。
由索引模型根据 Issue 内容生成。
描述
Context
BitFun's ACP client currently only surfaces context-window usage (ContextUsageUpdated / AcpSessionContextUsage) for attached agents. However, the ACP wire already carries per-session cumulative token usage on session/prompt responses, per the ACP spec's SessionUsage type:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"stopReason": "end_turn",
"usage": { "inputTokens": 19683, "outputTokens": 3, "totalTokens": 19686 }
}
}
(captured from a real session/prompt round against the omp acp agent, i.e. oh-my-pi's native ACP server)
Proposal
Consume the usage field from prompt results in the ACP client layer (src/crates/interfaces/acp/src/client/stream.rs / manager.rs) and feed it into the existing web-ui token usage pipeline (src/web-ui/src/flow_chat/types/flow-chat.ts → TokenUsage, src/web-ui/src/flow_chat/utils/tokenUsageDisplay.ts), so ACP-attached agents show per-session token usage the same way internal-harness agents already do.
Notes
- Today only some agents emit the field (omp does; kimi-code's
kimi acpand zed'sclaude-code-acp/codex-acpadapters currently don't). Displaying it where available costs nothing and gives adapter authors an incentive to fill it in. - This is about token counts, not plan quota — I'll file the quota display idea separately.
Happy to test a PR branch against my local fleet (kimi / omp / claude / codex adapters) if useful.
- 主要语言
- Rust
- 星标
- 2.3k
- 派生
- 236
- 平均合并
- 3 小时 38 分钟
- 30 天内合并 PR
- 329
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GCWing/OpenBitFun 的其他 Issue
-
难度 2/5 半天 新手友好度 74/100
GCWing/OpenBitFun#3279 ·
维护者通常 1 天内回复
-
[Bug]: 界面写“敏感诊断信息默认关闭”,但后端配置当前实际默认是 true可能已有人在做 @xiechimon 于 17 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
GCWing/OpenBitFun#3213 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
GCWing/OpenBitFun#2363 ·
维护者通常 1 天内回复
-
question
难度 1/5 1 小时以内 新手友好度 78/100
GCWing/OpenBitFun#2340 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 40/100
GCWing/OpenBitFun#3346 ·
维护者通常 1 天内回复
查看 GCWing/OpenBitFun 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
EasyTier/EasyTier#2672 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 84/100
repowise-dev/repowise#3374 ·
维护者通常 1 天内回复
-
awaiting-response bug needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复