[Skip to content](https://github.com/NousResearch/hermes-agent/pull/99649#start-of-content)

You signed in with another tab or window. [Reload](https://github.com/NousResearch/hermes-agent/pull/99649) to refresh your session.You signed out in another tab or window. [Reload](https://github.com/NousResearch/hermes-agent/pull/99649) to refresh your session.You switched accounts on another tab or window. [Reload](https://github.com/NousResearch/hermes-agent/pull/99649) to refresh your session.Dismiss alert

{{ message }}

## Conversation

[![@alizahid82](https://avatars.githubusercontent.com/u/294241673?s=80&v=4)](https://github.com/alizahid82)

### ![@alizahid82](https://avatars.githubusercontent.com/u/294241673?s=48&v=4)**[alizahid82](https://github.com/alizahid82)**     commented   [on Aug 31Aug 31, 2026](https://github.com/NousResearch/hermes-agent/pull/99649\#issue-5303528189)


Copy link


Copy Markdown

## Summary

Adds a `cost` field to the CLI/TUI status bar's `display.status_bar.fields` config. When explicitly listed, the bar renders the running session spend from `agent.session_estimated_cost_usd` via `format_cost_label`, so it inherits the sub-cent honesty rules from [#79220](https://github.com/NousResearch/hermes-agent/issues/79220):

- `$0.00` for zero
- `~$0.0046` (4 dp) for sub-cent amounts
- `~$<0.0001` when a positive amount would round to zero at 4 dp
- `~$1.23` (2 dp) for normal magnitudes

Follows the exact opt-in contract of `total_tokens` (Σ): **default bars never widen** — the field only appears when listed:

```
display:
  status_bar:
    fields: [model, context_detail, context_pct, cache_hit, latency, tps, duration, cost]
```

Both renderers are supported: the plain-text path (`_build_status_bar_text`) and the prompt\_toolkit fragment path (`_get_status_bar_fragments`). The available-fields documentation in `config_defaults.py` now lists `cost` alongside `total_tokens`.

## Motivation

The per-session cost is already tracked (`session_estimated_cost_usd`, persisted to `state.db` and surfaced by `/usage`), but there was no way to see it at a glance while working. This puts live spend in the existing telemetry bar without changing anything for users who don't ask for it.

## Test plan

- 5 new tests in `TestStatusBarFieldConfig` (`tests/cli/test_cli_status_bar.py`): opt-in render, zero, sub-cent floor label, 2 dp normal, hidden-by-default
- Full `TestStatusBarFieldConfig` \+ `TestCLIStatusBar` suites pass (53/53)
- Verified the remaining `tests/cli` failures on this machine (worktree, bang-shell, PTY/terminal-compat tests) reproduce identically on clean `origin/main` — pre-existing Windows-PTY issues, unrelated to this change

Sorry, something went wrong.


### Uh oh!

There was an error while loading. [Please reload this page](https://github.com/NousResearch/hermes-agent/pull/99649).

All reactions

[![@alizahid82](https://avatars.githubusercontent.com/u/294241673?s=40&v=4)](https://github.com/alizahid82)

`
          feat(cli): opt-in 'cost' status-bar field showing live session spend
` …

`
          e824808
`

```
Adds 'cost' to display.status_bar.fields. When explicitly listed, the
bar renders the running session cost from agent.session_estimated_cost_usd
using format_cost_label - inheriting the sub-cent honesty rules from
NousResearch#79220 (~$0.0046 / ~$<0.0001 / $0.00 for zero, ~$1.23 for normal).

Follows the exact opt-in contract of total_tokens (sum): default bars
never widen; the field only appears when listed in
display.status_bar.fields. Both the plain-text renderer
(_build_status_bar_text) and the prompt_toolkit fragment renderer
(_get_status_bar_fragments) support it, and the available-fields
documentation in config_defaults.py now lists it.

Tests: 5 new in TestStatusBarFieldConfig (opt-in render, zero,
sub-cent floor, 2dp normal, hidden-by-default).
```

[![@alt-glitch](https://avatars.githubusercontent.com/u/52913345?s=40&u=b0d1b58e0f8358f695a038e6f8c8dcf02e5963b0&v=4)](https://github.com/alt-glitch)[alt-glitch](https://github.com/alt-glitch)

added
[type/feature](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Atype%2Ffeature) New feature or request [P3](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3AP3) Low — cosmetic, nice to have [comp/cli](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Acomp%2Fcli) CLI entry point, hermes\_cli/, setup wizard [area/config](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Aarea%2Fconfig) Config system, migrations, profiles [area/usage-cost](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Aarea%2Fusage-cost) Token accounting, usage reporting, billing, cost tracking [sweeper:risk-compatibility](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Asweeper%3Arisk-compatibility) Sweeper risk: may break existing users, config, migrations, defaults, or upgrades

labels

[on Aug 31Aug 31, 2026](https://github.com/NousResearch/hermes-agent/pull/99649#event-30298224377)

[![@Enough1122](https://avatars.githubusercontent.com/u/10966420?s=80&u=a6e4690f63e5c29cf8d27b235b5e59658c2c05d7&v=4)](https://github.com/Enough1122)

### **[Enough1122](https://github.com/Enough1122)**     commented   [on Sep 1Sep 1, 2026](https://github.com/NousResearch/hermes-agent/pull/99649\#issuecomment-5497474186)


Copy link


Copy Markdown

|     |
| --- |
| > AI code review — automated review for reference; please use your judgment.<br>A small, low-risk feature: the status bar can now render estimated session cost in USD via an opt-in `cost` field, mirroring the existing `total_tokens` contract exactly — it never shows unless explicitly listed in `display.status_bar.fields`, and the snapshot reads `agent.session_estimated_cost_usd` defensively with a `0` fallback. The rendering reuses `format_cost_label` so the sub-cent honesty rules apply unchanged, wraps the value in `Decimal(str(...))` to avoid float precision artifacts, and is exception-isolated via a deferred import inside the render path. Tests cover explicit display, hidden-by-default, zero, sub-cent flooring, and 2dp formatting.<br>Non-blocking:<br>- The `try/except Exception: pass` swallows any formatting failure silently; acceptable for a status-bar path that must never break rendering, but it also hides genuine regressions in `format_cost_label`.<br>- The cost block is duplicated across the two (wide/narrow) render functions — consistent with the existing `total_tokens` duplication, so it follows the file's current pattern, but it's the same maintenance smell.<br>**Verdict: LGTM** |

All reactions

Sorry, something went wrong.


### Uh oh!

There was an error while loading. [Please reload this page](https://github.com/NousResearch/hermes-agent/pull/99649).

[![@kvnloo](https://avatars.githubusercontent.com/u/7121943?s=80&u=dd3159c621b5143a0b7f7c2bf63074016dfd7bba&v=4)](https://github.com/kvnloo)

### **[kvnloo](https://github.com/kvnloo)**     commented   [on Sep 14Sep 14, 2026](https://github.com/NousResearch/hermes-agent/pull/99649\#issuecomment-5671371854)


Copy link


Copy Markdown

|     |
| --- |
| Exact-head comment on [#99649](https://github.com/NousResearch/hermes-agent/pull/99649) head [`e824808`](https://github.com/NousResearch/hermes-agent/commit/e82480875e4cc5c212a49cf421fe8185925e2e22).<br>KEEP opt-in status-bar field `cost` reading `session_estimated_cost_usd` through `format_cost_label` (same sub-cent honesty as [#79220](https://github.com/NousResearch/hermes-agent/issues/79220) / same opt-in contract as `total_tokens`). KEEP docs in `config_defaults.py` listing `cost` as never-on-by-default. KEEP `test_cost_when_explicitly_requested` / zero / hidden-by-default.<br>CHECK: deferred import stays exception-isolated on the render path. CHECK: narrow terminals still drop wide fields independently. CHECK: do not auto-enable `cost` in the empty default `fields: []` set.<br>Author alizahid82 not kvnloo. No competing PR from me. |

All reactions

Sorry, something went wrong.


### Uh oh!

There was an error while loading. [Please reload this page](https://github.com/NousResearch/hermes-agent/pull/99649).

### This branch has not been deployed

No deployments


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](https://github.co/hiddenchars)

[Show hidden characters](https://github.com/NousResearch/hermes-agent/pull/99649)

[Sign up for free](https://github.com/join?source=comment-repo) **to join this conversation on GitHub**.
Already have an account?
[Sign in to comment](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNousResearch%2Fhermes-agent%2Fpull%2F99649)

### Reviewers

No reviews

### Assignees

No one assigned

### Labels

[area/config](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Aarea%2Fconfig) Config system, migrations, profiles [area/usage-cost](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Aarea%2Fusage-cost) Token accounting, usage reporting, billing, cost tracking [comp/cli](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Acomp%2Fcli) CLI entry point, hermes\_cli/, setup wizard [P3](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3AP3) Low — cosmetic, nice to have [sweeper:risk-compatibility](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Asweeper%3Arisk-compatibility) Sweeper risk: may break existing users, config, migrations, defaults, or upgrades [type/feature](https://github.com/NousResearch/hermes-agent/issues?q=state%3Aopen%20label%3Atype%2Ffeature) New feature or request

### Projects

None yet

### Milestone

No milestone

### Development

Successfully merging this pull request may close these issues.

None yet

### 4 participants

[![@alizahid82](https://avatars.githubusercontent.com/u/294241673?s=52&v=4)](https://github.com/alizahid82)[![@Enough1122](https://avatars.githubusercontent.com/u/10966420?s=52&v=4)](https://github.com/Enough1122)[![@kvnloo](https://avatars.githubusercontent.com/u/7121943?s=52&v=4)](https://github.com/kvnloo)[![@alt-glitch](https://avatars.githubusercontent.com/u/52913345?s=52&v=4)](https://github.com/alt-glitch)

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.

You can’t perform that action at this time.