Dashboard: Token outlook is blank because token usage is not reaching daily accounting #975
Notifications
Due Date
No due date set.
Depends on
Reference: sam/archie#975
Reference in new issue
Block a user
Problem
The dashboard's Token outlook card is blank instead of showing token usage/spend. The screenshot shows the card present but with no usable content.
Investigation
The live dashboard API currently returns:
The dashboard frontend expects
tokens_by_dayand renders the empty state when it is missing/empty (ui/src/dashboard/dashboard.js:405-418). The runtime therefore has token totals in thetaskstable but no daily token series for the card.The persistence path is inconsistent:
internal/domain/workflow/agent.go:171-176recordsres.TokensUsedon the task and emits anagent_finishevent withdata.tokens.internal/store/events.go:231-251calculates the card data exclusively from persistedagent_finishevents.task_queuedandturn_completedevents but noagent_finishrows, while workflow statistics still contain 904,901 tokens.handleSummaryserializes the nil result fromTokensByDayas JSONnull, rather than a stable empty array or a meaningful unavailable state.This means the dashboard cannot truthfully show spend even though token usage is already tracked elsewhere.
Expected behaviour
tokens_by_day: []rather thannullwhen no data exists.Acceptance criteria
tokens_used, but noagent_finishrows; the summary must still have a defined, truthful token state.TokensByDay, including NATS/container execution.null.Scope
This issue is about truthful token accounting and the Token outlook dashboard. It does not attempt to add provider billing APIs or dollar pricing unless required to make the existing token accounting correct.
Close reason
Closed
Imported from beads
archie-core-1786748942590-20-c21c728b· GitHub #515 · type bug · priority P2 · created 2026-08-14 · closed 2026-09-05