Skip to content

fix(credits): grant-spent notice yields on the next prompt#40367

Merged
alt-glitch merged 1 commit into
mainfrom
fix/credits-grant-spent-yield
Jun 6, 2026
Merged

fix(credits): grant-spent notice yields on the next prompt#40367
alt-glitch merged 1 commit into
mainfrom
fix/credits-grant-spent-yield

Conversation

@alt-glitch

Copy link
Copy Markdown
Collaborator

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

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.
@alt-glitch alt-glitch enabled auto-merge (squash) June 6, 2026 07:58
@alt-glitch alt-glitch merged commit c79b6f2 into main Jun 6, 2026
20 checks passed
@alt-glitch alt-glitch deleted the fix/credits-grant-spent-yield branch June 6, 2026 08:02

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

This PR is well-scoped and the implementation matches the stated intent:

  • ui-tui/src/app/turnController.ts: The existing credits.usage clear-on-next-prompt logic has been correctly generalized to also clear credits.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_spent path.

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.
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.

2 participants