[Feature]: Track actual Agent token usage per turn and measure context costs
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- electron, typescript
- Área
- desktop-dev
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.7k
- Forks
- 231
- Merge medio
- 16 h 38 min
- PR fusionados (30 d)
- 327
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getopenscreen/openscreen
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getopenscreen/openscreen#1423 ·
Los mantenedores suelen responder en 1 día
-
Native review wanted: machine-translated recording bar tooltips (14 locales)Quizá libre de nuevo @auberginewly la tomó hace 21 días y no hay ningún pull request abierto. Abiertogood first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
getopenscreen/openscreen#913 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
QA: e2e pass on v2.2.0-rc.1 (macOS, Windows)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
getopenscreen/openscreen#1431 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 Medio día Aptitud para principiantes 68/100
getopenscreen/openscreen#1428 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
getopenscreen/openscreen#1426 ·
Los mantenedores suelen responder en 1 día
Todos los issues de getopenscreen/openscreen
Issues similares
-
bug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
PhyberApex/kuroshiro#1687 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
microsoft/monaco-editor#5563 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
awslabs/visual-asset-management-system#937 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100