[Feature]: Track actual Agent token usage per turn and measure context costs
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 22/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- electron, typescript
- 领域
- desktop-dev
调研方向
Start from the desktop Agent turn code that issues model calls and collects provider usage fields, and from the chat context indicator fed by #312 so the cumulative summary stays separate from it. Read the Workbench usage accounting from #653 before adding any new measurement path. Done means multi-call turns sum usage without double counting, missing usage is shown as incomplete, and summaries persist across restart. The maintainer has not yet confirmed scope, so agree on it before implementing.
由索引模型根据 Issue 内容生成。
描述
Problem
Splitting the AI-token feedback out of #677, as requested by the maintainer. The reporter describes roughly 62,000 tokens used for AI editing and difficulty understanding which settings reduce consumption. This is a user report, not a reproduced measurement.
Current context occupancy and cumulative tokens consumed across an Agent turn answer different questions: a multi-step turn may send context repeatedly.
Existing work
- #312 already feeds the chat context indicator from the native chat-budget path, including compacted model context. Preserve it and distinguish it from cumulative usage.
- #653 already adds Workbench usage accounting and versioned measurement/replay tooling (part of #459). Reuse this rather than build another measurement system.
- I found no currently open PR dedicated to desktop per-turn usage and context-cost measurement. Please flag overlapping work before implementation.
Proposed first increment
- Aggregate provider-reported input/output tokens across model calls in a desktop Agent turn. Include cached/reasoning details when available without double-counting subsets of totals.
- Show a concise per-turn summary separate from the context indicator. Mark missing/partial usage as unavailable/incomplete, not zero; clearly label any estimates.
- Persist the summary with chat messages so reopening a project preserves it. Store usage metadata only, without credentials or raw provider payloads.
- Measure short/long transcripts and repeated editing turns in reproducible Workbench scenarios. Record provider/model, call count, usage completeness and editing outcomes alongside token totals.
Follow-up based on evidence
Compare range-limited transcript reads, smaller tool results, less repeated project context or adjusted compaction only after identifying the bottleneck. Verify editing outcomes alongside any token reduction.
Exact pre-run cost promises and hard token caps are outside this first increment and need separate design discussion.
Validation
- Multi-call turns sum available usage without double counting; missing/partial usage is explicit.
- Usage remains attached to the originating project/session/turn when sessions switch during a run.
- Completed-turn summaries survive restart and project reopening.
- Claimed reductions include reproducible before/after evidence and editing-quality checks.
I am interested in taking on the initial usage-accounting and measurement work if this scope fits the project direction.
- 主要语言
- TypeScript
- 星标
- 3.7k
- 派生
- 231
- 平均合并
- 16 小时 25 分钟
- 30 天内合并 PR
- 331
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getopenscreen/openscreen 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
getopenscreen/openscreen#1423 ·
维护者通常 1 天内回复
-
Native review wanted: machine-translated recording bar tooltips (14 locales)可能重新可做 @auberginewly 于 20 天前认领,目前没有进行中的 PR。 未关闭good first issue help wanted
难度 2/5 1-3 小时 新手友好度 68/100
getopenscreen/openscreen#913 · 5 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 57/100
getopenscreen/openscreen#1422 ·
维护者通常 1 天内回复
-
macOS: pick the YCbCr matrix per buffer instead of hard-coding BT.709可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
getopenscreen/openscreen#1420 ·
维护者通常 1 天内回复
-
[Feature]: completely disable HuggingFace connection button可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement
难度 3/5 1-2 天 新手友好度 48/100
getopenscreen/openscreen#1419 ·
维护者通常 1 天内回复
查看 getopenscreen/openscreen 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
area:plugins area:security area:skills bug has repro
难度 2/5 1-3 小时 新手友好度 76/100
anthropics/claude-code#105911 ·
维护者通常 1 天内回复
-
documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 74/100
dev-five-git/devup-ui#879 ·
维护者通常 11 天内回复
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifacts未关闭
难度 2/5 1-3 小时 新手友好度 72/100
Fission-AI/OpenSpec#2165 ·
维护者通常 1 天内回复
-
🐞 bug 🧐 unconfirmed
难度 2/5 1-3 小时 新手友好度 66/100
Tencent/tdesign-vue-next#7032 · 1 条评论 ·
维护者通常 1 天内回复