Skip to content

feat: show agentsview cost estimate in the queue view#737

Merged
wesm merged 2 commits into
mainfrom
feat/session-cost-display
May 24, 2026
Merged

feat: show agentsview cost estimate in the queue view#737
wesm merged 2 commits into
mainfrom
feat/session-cost-display

Conversation

@wesm
Copy link
Copy Markdown
Member

@wesm wesm commented May 23, 2026

Summary

  • internal/tokens selects the agentsview usage command via a capability probe: agentsview session usage <id> --format json on agentsview >= 0.30.0, falling back to the deprecated token-use on 0.15.0-0.29.x. The new cost_usd/has_cost fields are parsed into Usage.
  • Usage exit codes 2 (session not found) and 3 (found, no token/cost data) are treated as "no usage" rather than errors. The legacy token-use exit-1 empty-output case is still handled, so older agentsview keeps working.
  • FormatSummary appends · ~$0.42 when a cost estimate is present (the review detail view renders this automatically); FormatCost returns the cost alone.
  • The TUI queue gains a default-visible "Cost" column showing the per-job estimate, blank when the model is unpriced or usage has not been fetched yet.
  • Cost populates once agentsview 0.30.0 (feat: add 'agentsview session usage' command with cost estimate agentsview#536) is installed; on older versions the column stays blank and token counts are unaffected. A backfill-tokens run refreshes existing jobs.

🤖 Generated with Claude Code

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 23, 2026

roborev: Combined Review (ac49bcb)

Summary verdict: No Medium, High, or Critical findings to report.

All reported issues are below Medium severity or found no issues, so there are no findings to include for this PR comment.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

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>
@wesm wesm force-pushed the feat/session-cost-display branch from ac49bcb to 2cdedfa Compare May 23, 2026 22:57
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 23, 2026

roborev: Combined Review (2cdedfa)

No Medium, High, or Critical issues found.

Both completed reviews report the diff is clean.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

Note: gemini review skipped (agent quota exhausted)

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 24, 2026

roborev: Combined Review (6244944)

No Medium, High, or Critical findings were reported.

All review outputs are clean at the requested severity threshold.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@wesm wesm merged commit da4e422 into main May 24, 2026
8 checks passed
@wesm wesm deleted the feat/session-cost-display branch May 24, 2026 20:31
@wesm
Copy link
Copy Markdown
Member Author

wesm commented May 24, 2026

This is tested and working for me (see roborev backfill-tokens for populating history) with agentsview 0.30.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant