Repository navigation
Closed
Description
It confused me to see costs when I was viewing a Bob session:
abctl · Can I configure environment variables for Bob Shell to use when it starts? (cf6d4a762a052c650dbe46ee933d676d)
LAST 1H $7.53+ · TODAY $31.25+ · 7 DAYS ~$618.07+ · THIS MONTH —
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# DIR PHASE METHOD STATUS DURATION TOKENS COST▼ HOST
1 out req premium-ide 8,131 api.us-east.bob.ibm…
1 out resp premium-ide 200 3.12s 117 api.us-east.bob.ibm…
2 out req initialize api.us-east.bob.ibm…
2 out resp initialize 200 30ms api.us-east.bob.ibm…
3 out req notifications/ini… api.us-east.bob.ibm…
3 out resp notifications/ini… 202 26ms api.us-east.bob.ibm…
5 out req tools/list api.us-east.bob.ibm…
5 out resp tools/list 200 30ms api.us-east.bob.ibm…
6 out req tools/call api.us-east.bob.ibm…
6 out resp tools/call 200 173ms api.us-east.bob.ibm…
7 out req premium-ide 9,217 api.us-east.bob.ibm…
7 out resp premium-ide 200 2.24s 36 api.us-east.bob.ibm…
If a session has no cost, I expected the cost bar to show $0 or unknown.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
huang195 commentedon Oct 7, 2026
the top bar was meant to be a cost dashboard that shows the overall cost info. at least that was the original intention. but maybe that's confusing.
test: Cover the scoped band's width, and classify every pane
Fix: Say the spend band is proxy-wide when drilled into a session (#1372
esnible commentedon Oct 14, 2026
Findings from looking at whether the session view can show this session's cost instead of
the proxy-wide band.
Short answer: partly. agentop can show this session's lifetime cost and its LAST 1H. It
cannot show TODAY, 7 DAYS or THIS MONTH for one session.
SessionSummary.CostMicros, plusSaturated,Currencies,AvoidedMicros,TotalTokens(store.go#L899-L954). agentop re-fetches/v1/sessionson every refresh tick, including while drilled in (app.go#L1639), and the session header already reads its title from that list.GET /v1/usage?window=1h&session=<id>, served from the in-memory usage buffer (usage.go#L213-L214). Pressinguon the events pane already opens a Usage pane scoped to the session this way./v1/usageanswerssession=with any of these windows with a 400 (usage.go#L184-L201).The band ignores the session on purpose, which matches @huang195's comment:
fetchSpendSpancalls it "a per-proxy reading"(spend.go#L943-L946).
Details that matter for any fix:
CostMicrosis omitted when nothing was priced, so it neverrenders as
$0.00, and the sessions table already draws—for it. Thepremium-iderequests in this session have no price (their COST cells are blank), so a per-session figure
here would read
—, which is "unknown" rather than$0.SessionSummaryhas no counts ofunpriced or inexact requests, so a session where only some requests were priced would look
complete; it can't wear the band's
+or~. The per-session LAST 1H reply does carry thosecounts (usage.go#L241-L292),
so that figure can be marked the same way the band marks its figures.
archive it continues across restarts. Without one, which is any cluster sidecar, it starts
over when the proxy restarts.
cost record, so the server could sum a session's own events by day (on a local install the
archive keeps 30 days). That would be new server work.
One possible shape for a fix: on the events and detail panes, show
THIS SESSION(lifetime,from the session list) and
LAST 1H(session-scoped) in place of the proxy-wide band, dropthe three spans that can't be answered per session, and bring the proxy-wide band back on Esc.
Another: keep the proxy-wide band, caption it
ALL SESSIONSwhen drilled in, and put thesession's cost on the header line.
Assisted-By: Claude (Anthropic AI) [email protected]
huang195 commentedon Nov 6, 2026
PR #1372 fixed this. When you drill into a session, the spend band now has the caption
ALL SESSIONS(cmd/agentop/tui/spend_band.go:247). This is the second fix in the last comment.The band does not show
$0. The ledger has no session key, so TODAY, 7 DAYS and THIS MONTH are not available for one session. A cost band for one session needs a new issue.Assisted-By: Claude (Anthropic AI) [email protected]