[Feature]: Track actual Agent token usage per turn and measure context costs
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 22/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- electron, typescript
- Domaine
- desktop-dev
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- TypeScript
- Étoiles
- 3.7k
- Forks
- 231
- Merge moyen
- 16 h 25 min
- PR mergées (30 j)
- 331
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de getopenscreen/openscreen
-
build.yml: macOS arm64 DMG fails, cargo missing on the macos-26 runner imagePeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
getopenscreen/openscreen#1423 ·
Les mainteneurs répondent en général sous 1 jour
-
Native review wanted: machine-translated recording bar tooltips (14 locales)Peut-être à nouveau libre @auberginewly l’a pris il y a 20 jours, et aucune pull request n’est ouverte. Ouvertegood first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
getopenscreen/openscreen#913 · 5 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 57/100
getopenscreen/openscreen#1422 ·
Les mainteneurs répondent en général sous 1 jour
-
macOS: pick the YCbCr matrix per buffer instead of hard-coding BT.709Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
getopenscreen/openscreen#1420 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
getopenscreen/openscreen#1419 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de getopenscreen/openscreen
Issues similaires
-
area:plugins area:security area:skills bug has repro
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
anthropics/claude-code#105911 ·
Les mainteneurs répondent en général sous 1 jour
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifactsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Fission-AI/OpenSpec#2165 ·
Les mainteneurs répondent en général sous 1 jour
-
🐞 bug 🧐 unconfirmed
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Tencent/tdesign-vue-next#7032 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
gnosis/gnosis_vpn#661 ·
Les mainteneurs répondent en général sous 1 jour
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Ouvertetriage:bug-verified
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
Les mainteneurs répondent en général sous 1 jour