mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-24 16:54:43 +00:00
The desktop renderer had no handler for the `notification.show` / `notification.clear` WS events, so every credit-usage notice the backend sends (`agent/credits_tracker.py` → `tui_gateway/server.py`) was silently dropped. Credit warnings like "• Credits 50% used · $220.00 cap" never appeared, even though the Ink TUI renders them in its status bar. Add the two missing branches to the gateway-event dispatcher, delegating to a small, pure-testable module: - `store/agent-notices.ts` — `noticeToToast()` maps a notice to a toast (level → toast kind, sticky → durationMs 0, ttl → ttl_ms), and uses the notice `key` as the toast id. Re-emitting the same key REPLACES the toast, so the credits 50→75→90 line escalates in place instead of stacking, and a key-matched `notification.clear` maps straight to `dismissNotification(key)`. - The notice `text` already carries its own glyph (• ⚠ ✕ ✓), so no toast icon is added. - Notices are account-wide, so the toast shows regardless of which session is focused. The Ink TUI (`ui-tui/src/app/turnController.ts`) is the reference for the latest-wins / sticky-vs-ttl / key-matched-clear behavior. Export `NotificationInput` so the mapping's return type can be named. |
||
|---|---|---|
| .. | ||
| bootstrap-installer | ||
| desktop | ||
| shared | ||