Skip to content

feat: display token usage and cost in session detail view #341

@bencered

Description

@bencered

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions