fix(credits): grant-spent notice yields on the next prompt#40367
Merged
Conversation
credits.grant_spent is a one-time "your monthly grant is used up, you're now on top-up" heads-up, but it was sticky — it camped the TUI status bar until the grant refilled, so a user with healthy top-up saw "Grant spent · $990 top-up left" indefinitely. Treat it like the usage-band notice: flash once, then clear on the next prompt (startMessage). Depletion stays sticky (you actually can't make requests). The Python `active` latch keeps the key, so it won't re-fire next turn.
tonydwb
approved these changes
Jun 6, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
This PR is well-scoped and the implementation matches the stated intent:
ui-tui/src/app/turnController.ts: The existingcredits.usageclear-on-next-prompt logic has been correctly generalized to also clearcredits.grant_spent, which is a one-time flash-and-yield notice. The existing latch (active) is documented as retained, so yielded notices won't re-fire on the next turn.- Test added: covers the new
grant_spentpath.
Both the docstring update and the new test case are consistent with the existing pattern.
The only observation: consider adding a second test that verifies credits.usage is still cleared after this change (i.e., the generalization didn't accidentally break the existing case) — but the existing test names suggest this is already covered.
Reviewed by Hermes Agent
PatrickNoFilter
pushed a commit
to PatrickNoFilter/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ousResearch#40367) credits.grant_spent is a one-time "your monthly grant is used up, you're now on top-up" heads-up, but it was sticky — it camped the TUI status bar until the grant refilled, so a user with healthy top-up saw "Grant spent · $990 top-up left" indefinitely. Treat it like the usage-band notice: flash once, then clear on the next prompt (startMessage). Depletion stays sticky (you actually can't make requests). The Python `active` latch keeps the key, so it won't re-fire next turn.
changman
pushed a commit
to changman/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ousResearch#40367) credits.grant_spent is a one-time "your monthly grant is used up, you're now on top-up" heads-up, but it was sticky — it camped the TUI status bar until the grant refilled, so a user with healthy top-up saw "Grant spent · $990 top-up left" indefinitely. Treat it like the usage-band notice: flash once, then clear on the next prompt (startMessage). Depletion stays sticky (you actually can't make requests). The Python `active` latch keeps the key, so it won't re-fire next turn.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The "grant spent" status-bar notice now flashes once and clears on your next message, instead of sitting there for the rest of the session.
Why
"Grant spent" means your monthly credit grant is used up and you're now drawing on top-up credits — a useful one-time heads-up. But it was sticky: with healthy top-up left it just camped the status bar (
• Grant spent · $990 top-up left) with nothing actionable. It now behaves like the 50 / 75 / 90% usage warnings — show once, then yield on your next prompt. The "credit access paused" (depleted) notice stays put, since that one means you actually can't make requests.Notes
turnControllerNotice.test.ts).