Usage view: per-model breakdown, daily trend and CSV export
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, rust, tauri, typescript
Línea de trabajo
Start with docs/guide/llm-call-ledger.md and crates/agent-core/src/usage.rs, then trace usage aggregation in crates/daemon-api/src/routes.rs and crates/daemon-api/src/dto.rs; review apps/desktop/ui/src/views/UsageView.tsx for the existing range selector and UI patterns. Propose the response shape in the issue before implementing, as requested. Done means model totals, daily local-time buckets, unknown usage, CSV export, and the specified tests and schema updates meet the acceptance criteria.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
size: M · first-timer: no
Summary
Extend the Usage view with a per-model breakdown, a daily trend and CSV export, so users can see which model costs what, how usage develops over time, and take the numbers elsewhere.
Why it matters
The usage view answers "which bot used how much". People choosing between models (or between a cloud model and a local one) need "which model", and people with a budget need to see whether the trend is going up. It also complements per-bot limits (#210), which need a clear picture of past spend.
Current state
GET /v1/usageaggregates over runs and returns a total,by_botandby_purpose(UsageSummaryincrates/daemon-api/src/dto.rs, computed inroutes.rs). The UI (apps/desktop/ui/src/views/UsageView.tsx) shows totals and a per-bot table with a range selector (all, day, week, month).- Every model call is recorded in the LLM call ledger with purpose, model, tokens and optional
cost_usd(UsageCallincrates/agent-core/src/usage.rs,docs/guide/llm-call-ledger.md), so the data for a per-model view exists; it is not aggregated or returned. - The ledger doc is explicit that unknown token counts do not mean zero, and cost can be unknown (CLI engines, failed calls, embeddings); the view must not present unknown as zero.
- There is no time series and no export.
Proposal and suggested approach
- Daemon. Add
by_modeland a daily series (bucketed in the user's local time zone, bounded number of days) to the usage summary, keeping existing fields unchanged (additive, optional for older clients). Calls with unknown tokens or cost are counted separately ("n calls without usage data"). - UI. A model table next to the bot table, and a small bar or sparkline per day with an accessible text alternative (a table behind it); an "unknown" marker wherever cost is not known. Use the shared design tokens and the existing chart conventions if any; do not add a heavy charting dependency without discussing it in the issue.
- Export. "Download CSV" of the current range (day, bot, model, purpose, calls, tokens in/out, cost or empty); in the app through a save action. Formula-injection safe (cells that start with
=,+,-or@are prefixed). - Tests for the aggregation (unknown usage, several models per run, subagents counted once, time-zone edges), UI helper tests, and golden CSV.
Acceptance criteria
- Per-model totals add up to the overall total for calls that report usage; calls without usage are shown separately.
- The daily series respects the selected range and local midnight.
- The OpenAPI snapshot and the generated schema are updated (
CONTRIBUTING.md);check:i18n, lint, typecheck,cargo test -p daemon-api -p agent-corepass.
Out of scope
Budgets and limits (#210), price changes or catalog edits, provider balance lookups, and cross-device aggregation.
How to get started
Read docs/guide/llm-call-ledger.md, crates/agent-core/src/usage.rs, the usage code in crates/daemon-api/src/routes.rs, and views/UsageView.tsx. Comment here with the response shape you propose.
- Lenguaje dominante
- Rust
- Estrellas
- 0
- Forks
- 1
- Merge medio
- 6 h 54 min
- PR fusionados (30 d)
- 152
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 emreocell/Praxi-Bot
-
area: desktop-ui enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Add an LLM provider presetAbiertoarea: daemon enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Contribute example skillsAbiertodocumentation enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Add a README to each core crateAbiertodocumentation good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
emreocell/Praxi-Bot#168 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
Todos los issues de emreocell/Praxi-Bot
Issues similares
-
bug ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
userFRM/egui-charts#3363 ·
Los mantenedores suelen responder en 1 día
-
ada documentation mobile report
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
physicsdolphin/nv-uefi-unlocker#254 · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
kindraywind/rustnarok-client#1382 ·
Los mantenedores suelen responder en 1 día
-
area:accessibility bug good first issue help wanted priority:p3-low size:small
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NecturaLabs/Canopy#209 ·
-
CLI config custom-model enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día