feat: add persistent CLI status bar and usage details#1522
Merged
Conversation
Salvaged from PR #1104 by kshitijk4poor. Closes #683. Adds a persistent status bar to the CLI showing model name, context window usage with visual bar, estimated cost, and session duration. Responsive layout degrades gracefully for narrow terminals. Changes: - agent/usage_pricing.py: shared pricing table, cost estimation with Decimal arithmetic, duration/token formatting helpers - agent/insights.py: refactored to reuse usage_pricing (eliminates duplicate pricing table and formatting logic) - cli.py: status bar with FormattedTextControl fragments, color-coded context thresholds (green/yellow/orange/red), enhanced /usage with cost breakdown, 1Hz idle refresh for status bar updates - tests/test_cli_status_bar.py: status bar snapshot, width collapsing, usage report with/without pricing, zero-priced model handling - tests/test_insights.py: verify zero-priced providers show as unknown Salvage fixes: - Resolved conflict with voice status bar (both coexist in layout) - Import _format_context_length from hermes_cli.banner (moved since PR)
3 tasks
This was referenced Mar 16, 2026
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
) Salvaged from PR NousResearch#1104 by kshitijk4poor. Closes NousResearch#683. Adds a persistent status bar to the CLI showing model name, context window usage with visual bar, estimated cost, and session duration. Responsive layout degrades gracefully for narrow terminals. Changes: - agent/usage_pricing.py: shared pricing table, cost estimation with Decimal arithmetic, duration/token formatting helpers - agent/insights.py: refactored to reuse usage_pricing (eliminates duplicate pricing table and formatting logic) - cli.py: status bar with FormattedTextControl fragments, color-coded context thresholds (green/yellow/orange/red), enhanced /usage with cost breakdown, 1Hz idle refresh for status bar updates - tests/test_cli_status_bar.py: status bar snapshot, width collapsing, usage report with/without pricing, zero-priced model handling - tests/test_insights.py: verify zero-priced providers show as unknown Salvage fixes: - Resolved conflict with voice status bar (both coexist in layout) - Import _format_context_length from hermes_cli.banner (moved since PR) Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
) Salvaged from PR NousResearch#1104 by kshitijk4poor. Closes NousResearch#683. Adds a persistent status bar to the CLI showing model name, context window usage with visual bar, estimated cost, and session duration. Responsive layout degrades gracefully for narrow terminals. Changes: - agent/usage_pricing.py: shared pricing table, cost estimation with Decimal arithmetic, duration/token formatting helpers - agent/insights.py: refactored to reuse usage_pricing (eliminates duplicate pricing table and formatting logic) - cli.py: status bar with FormattedTextControl fragments, color-coded context thresholds (green/yellow/orange/red), enhanced /usage with cost breakdown, 1Hz idle refresh for status bar updates - tests/test_cli_status_bar.py: status bar snapshot, width collapsing, usage report with/without pricing, zero-priced model handling - tests/test_insights.py: verify zero-priced providers show as unknown Salvage fixes: - Resolved conflict with voice status bar (both coexist in layout) - Import _format_context_length from hermes_cli.banner (moved since PR) Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
) Salvaged from PR NousResearch#1104 by kshitijk4poor. Closes NousResearch#683. Adds a persistent status bar to the CLI showing model name, context window usage with visual bar, estimated cost, and session duration. Responsive layout degrades gracefully for narrow terminals. Changes: - agent/usage_pricing.py: shared pricing table, cost estimation with Decimal arithmetic, duration/token formatting helpers - agent/insights.py: refactored to reuse usage_pricing (eliminates duplicate pricing table and formatting logic) - cli.py: status bar with FormattedTextControl fragments, color-coded context thresholds (green/yellow/orange/red), enhanced /usage with cost breakdown, 1Hz idle refresh for status bar updates - tests/test_cli_status_bar.py: status bar snapshot, width collapsing, usage report with/without pricing, zero-priced model handling - tests/test_insights.py: verify zero-priced providers show as unknown Salvage fixes: - Resolved conflict with voice status bar (both coexist in layout) - Import _format_context_length from hermes_cli.banner (moved since PR) Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
) Salvaged from PR NousResearch#1104 by kshitijk4poor. Closes NousResearch#683. Adds a persistent status bar to the CLI showing model name, context window usage with visual bar, estimated cost, and session duration. Responsive layout degrades gracefully for narrow terminals. Changes: - agent/usage_pricing.py: shared pricing table, cost estimation with Decimal arithmetic, duration/token formatting helpers - agent/insights.py: refactored to reuse usage_pricing (eliminates duplicate pricing table and formatting logic) - cli.py: status bar with FormattedTextControl fragments, color-coded context thresholds (green/yellow/orange/red), enhanced /usage with cost breakdown, 1Hz idle refresh for status bar updates - tests/test_cli_status_bar.py: status bar snapshot, width collapsing, usage report with/without pricing, zero-priced model handling - tests/test_insights.py: verify zero-priced providers show as unknown Salvage fixes: - Resolved conflict with voice status bar (both coexist in layout) - Import _format_context_length from hermes_cli.banner (moved since PR) Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
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.
Summary
Salvage of PR #1104 by @kshitijk4poor. Closes #683.
Adds a persistent status bar to the CLI that shows model name, context window usage (with visual bar), estimated cost, and session duration.
Status Bar
Responsive — degrades for narrow terminals:
Color-coded context thresholds: green (< 50%), yellow (50–80%), orange (80–95%), red (≥ 95%).
Enhanced
/usageCommandNow shows model name, per-category cost breakdown (input/output), session duration. Zero-priced provider models (GLM, Kimi, MiniMax) correctly show "n/a" instead of "$0.00".
Shared Pricing Module
Extracts pricing table + cost estimation + duration formatting from
agent/insights.pyintoagent/usage_pricing.py. Eliminates duplicate code between/insightsand/usage. UsesDecimalarithmetic to avoid floating-point rounding.Files Changed
agent/usage_pricing.pyagent/insights.pyusage_pricingcli.py/usage, 1Hz idle refreshtests/test_cli_status_bar.pytests/test_insights.pySalvage Fixes
_format_context_lengthimport (moved tohermes_cli/banner.pysince PR was written)Test Plan
python -m pytest tests/ -n0 -q # 4544 passedFollow-up Notes