Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

[Feature]: Track actual Agent token usage per turn and measure context costs

未關閉
#1,096 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@auberginewly 已經在處理了。

開始於 2026年10月13日。

  • #1177 來自 @auberginewly —— 未關閉

評估

難度
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 內容生成。

描述

enhancement

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

  1. 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.
  2. Show a concise per-turn summary separate from the context indicator. Mark missing/partial usage as unavailable/incomplete, not zero; clearly label any estimates.
  3. Persist the summary with chat messages so reopening a project preserves it. Store usage metadata only, without credentials or raw provider payloads.
  4. 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

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

getopenscreen/openscreen 的其他 Issue

查看 getopenscreen/openscreen 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。