internal/tokens now prefers `agentsview session usage <id> --format
json` on agentsview >= 0.30.0 and falls back to the deprecated
`token-use` on 0.15.0-0.29.x, selected via a capability probe. It
parses the new cost_usd/has_cost fields into Usage.
Usage exit codes 2 (session not found) and 3 (no token/cost data) are
treated as "no usage" rather than errors; the legacy token-use exit-1
empty-output case is still handled for older agentsview.
FormatSummary appends "· ~$0.42" when a cost estimate is present (the
review detail view picks this up automatically); FormatCost returns the
cost alone. The TUI queue gains a default-visible "Cost" column showing
the per-job estimate, blank when unpriced or not yet fetched.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
internal/tokensselects the agentsview usage command via a capability probe:agentsview session usage <id> --format jsonon agentsview >= 0.30.0, falling back to the deprecatedtoken-useon 0.15.0-0.29.x. The newcost_usd/has_costfields are parsed intoUsage.token-useexit-1 empty-output case is still handled, so older agentsview keeps working.FormatSummaryappends· ~$0.42when a cost estimate is present (the review detail view renders this automatically);FormatCostreturns the cost alone.backfill-tokensrun refreshes existing jobs.🤖 Generated with Claude Code