Repository navigation
feat(tui): estimate spend in the mini footer - #60659
augustovicente wants to merge 3 commits into
Conversation
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
The code looks sound. The new mini tests, the util/session tests and the footer/sidebar tests pass, and tsc -b passes. I couldn't see it working live: the review harness can't start mini/run mode, and the simulated model has no usage or prices. Could you attach a screenshot of the mini footer showing ≈ $X with the experiment on, and one with it off?
Public API: this commit doesn't change it. The experimental["cost-estimate"] config key only shows up in this diff because the branch is stacked on #59864, so this can only land after that one.
Two things are noted inline: with the experiment on, a provider that reports a real cost now shows a different number in the footer, and the new pricing field is never read.
f278b60 to
5f4e20e
Compare
|
Both inline notes are addressed in 5f4e20e (replied in their threads). On the screenshots: mini/run mode can't be started in the harness, but With the experiment on, provider reporting With it off: After the fix above, a provider that reports a cost keeps showing that step's reported figure in both modes; |
|
Review addressed in 5f4e20e — ready for another look.
Checking GitHub directly, this account can't request reviewers (read-only access), so a maintainer needs to re-request or approve. @opencodejr |
There was a problem hiding this comment.
Both earlier points are fixed. When a step reports a cost, the footer keeps showing that step's cost, and the estimate only appears when nothing was reported. The unused pricing field is gone. The mini and util/session tests and tsc -b pass on the new head. The public API is unchanged by these commits. I still couldn't run mini mode here, so a screenshot of the footer with the experiment on would help maintainers. Nothing new to flag.
5f4e20e to
d7ba2b6
Compare
There was a problem hiding this comment.
This push only rebases the branch onto the latest dev. Your commit has the same content as the one I reviewed last time, and the tests and tsc -b pass on the new head. The public API is unchanged by this push. Nothing new to flag. This still has to land after #59864, which is open, and a screenshot of the mini footer showing ≈ $X would still help maintainers.
d7ba2b6 to
772e2c6
Compare
|
Rebased onto Resolution notes:
@simonsilie if #59864 is not going to land soon it may be worth folding it into this one, since the mini footer change cannot compile without it. |
There was a problem hiding this comment.
This push only rebases the branch onto the latest dev. Your commit has the same content as the one I reviewed last time, and the mini, util/session and footer/sidebar tests and tsc -b in packages/tui pass on the new head. The public API is unchanged by this push. Nothing new to flag. This still has to land after #59864, which is open, and a screenshot of the mini footer showing ≈ $X would still help maintainers.
|
@augustovicente thanks for the hint. I have also rebase my PR and is now conflict free. At this point, I'm no longer sure if the maintainers even want my PR. I also don't know right now whether we'd have a better chance of success with one big PR than with two small ones. |
|
@simonsilie I agree — with #59864 now rebased onto current I don't have push access to your fork, so could you add the commit to
Verified on top of One bookkeeping note: this PR carried Closing this PR now to keep the work to a single one — the branch and commit stay here if anything is needed. |

Issue for this PR
Closes #60653
Type of change
What does this PR do?
Adds the
experimental["cost-estimate"]estimate to the mini/run footer, which #59864 leaves out of scope. When a provider reportscost: 0, the status line shows the catalog-priced session spend (≈ $5.25, or≈ <$0.01) instead of nothing; a positive recorded cost still wins.The estimate reads session totals from
session.getand livesession.usage.updatedevents, and prices observed assistant steps at their per-call context tier. Earlier, title, and compaction usage stays at untiered rates, matching the main footer. It covers the current session only: the main footer's root-family total needs the client store, which mini does not have.This branch is stacked on #59864 so it compiles before that PR lands — only the last commit is new. I'll rebase onto
devand drop the duplicate once #59864 merges.How did you verify your code works?
From
packages/tui:bun test --timeout 30000 test/mini bun run typecheck:tsc430 mini tests pass (2 skipped), including new unit tests for
sessionSpend, renderer assertions for≈ $X,≈ <$0.01, and recorded-cost precedence, plus a transport test forsession.usage.updated. The full TUI run is 1623 pass, 2 skip, and 1 failure incomponent/go-upsell-art.test.tsx; that test also fails in isolation on this machine and is untouched here.bun run checkpasses from the repository root.Visual
Screenshots / recordings
No screenshot attached. The footer renders as:
Checklist
Added by the opencode bot (AI-generated).
Related: #59861, #59923, #39740