The bridge already sends step_finish SSE events containing cost and tokens data from opencode, but the frontend currently ignores them. We should display cumulative token usage and cost in the session detail view.
Current State
bridge.py emits step_finish events with cost (dollar amount) and tokens (input/output counts)
- The frontend (
session/[id]/page.tsx) has no rendering for step_finish events
- No usage summary anywhere in the session UI
Proposed
- Track cumulative tokens (input + output) and cost from
step_finish events
- Display a usage summary bar in the session detail view (e.g. below the header or in the right sidebar)
- Show per-message token counts inline (subtle, like a tooltip or small badge)
- Update in real-time as new
step_finish events arrive via SSE
The bridge already sends
step_finishSSE events containingcostandtokensdata from opencode, but the frontend currently ignores them. We should display cumulative token usage and cost in the session detail view.Current State
bridge.pyemitsstep_finishevents withcost(dollar amount) andtokens(input/output counts)session/[id]/page.tsx) has no rendering forstep_finisheventsProposed
step_finisheventsstep_finishevents arrive via SSE