Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Feature: surface ACP prompt-result usage (token counts) in the existing token usage UI

未关闭
#3,077 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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 acp and zed's claude-code-acp / codex-acp adapters 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GCWing/OpenBitFun 的其他 Issue

查看 GCWing/OpenBitFun 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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