Feature: surface ACP prompt-result usage (token counts) in the existing token usage UI
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, typescript
- Domain
- backend-api-design, frontend
Research direction
Trace ACP prompt responses in src/crates/interfaces/acp/src/client/stream.rs and manager.rs, then follow the existing token pipeline through src/web-ui/src/flow_chat/types/flow-chat.ts and src/web-ui/src/flow_chat/utils/tokenUsageDisplay.ts. Confirm how ContextUsageUpdated and TokenUsage flow today. Done means ACP session/prompt usage is displayed in the existing token usage UI when the response provides it, without breaking agents that omit usage.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 236
- Avg merge
- 2h 56m
- Merged PRs (30d)
- 619
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GCWing/OpenBitFun
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
GCWing/OpenBitFun#3213 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GCWing/OpenBitFun#2363 ·
-
question
Difficulty 1/5 Under an hour Newbie friendliness 78/100
GCWing/OpenBitFun#2340 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
GCWing/OpenBitFun#3210 ·
-
GCWing/OpenBitFun#3195 · 2 comments · 1 assignee ·
All issues in GCWing/OpenBitFun
Similar issues
-
bug CLI custom-model
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100