Add token metrics across sessions, analytics, and UI#232
Add token metrics across sessions, analytics, and UI#232
Conversation
roborev: Combined Review (
|
|
@wesm my agent thinks it's best if we pause here and wait for your input re the bigger provenance trust/status model stuff, heh. I also captured the provenance/trust-boundary narrative in the PR body for Wes. Current state:
What is still unresolved:
My recommendation from here is:
If you want, I can next:
|
|
The intent with this feature/PR is presenting token consumption metrics as a first-class citizen within the UI. Especially now with the aggregated multi-agentsview stuff, it would be really valuable to see comprehensive token usage across all agents. |
- feat: add token analytics metrics - feat: surface token usage in the UI - docs: add token metrics design note
fba915d to
bb286fe
Compare
|
@wesm just FYI I've got an agent still cranking away on a "robust" solution for this... so I wouldn't put too much effort into reviewing the current state as it appears it's going to redo it pretty significantly (I could also do a separate PR for that so we can objectively compare what's going on). From what I can gather... the proper fix is more involved/nuanced. |
roborev: Combined Review (
|
|
OK I'll hold off on this one and cut 0.17.0 once I merge your codex subagent PR |
Summary
output_tokensanalytics to summary/heatmap/top-sessions plus CSV export and supporting API/store typesTest Plan
CC=cc CXX=c++ make ensure-embed-dir && CC=cc CXX=c++ go test -tags fts5 ./internal/db ./internal/parser ./internal/server ./internal/sync -run 'Token|Analytics|Upload|Incremental' -count=1CC=cc CXX=c++ TEST_PG_URL=postgres://agentsview_test:agentsview_test_password@localhost:5433/agentsview_test?sslmode=disable CGO_ENABLED=1 go test -tags 'fts5,pgtest' ./internal/postgres/... -run 'Token|Analytics|TopSessions|Heatmap|Store' -count=1cd frontend && npm test -- src/lib/api/client-token-metrics.test.ts src/lib/stores/analytics.test.ts src/lib/components/layout/SessionBreadcrumb.test.ts src/lib/components/content/MessageContent.test.ts src/lib/components/content/SubagentInline.test.ts src/lib/utils/csv-export.test.ts src/lib/utils/format.test.ts src/lib/stores/messages.test.ts src/lib/stores/sessions.test.ts && npm run checkReviewer Notes
pg push --full.output_tokenscontrols on server capability rather than silently assuming older servers support them.Closes #229