feat: add persistent CLI status bar and usage details#1104
Closed
kshitijk4poor wants to merge 3 commits intoNousResearch:mainfrom
Closed
feat: add persistent CLI status bar and usage details#1104kshitijk4poor wants to merge 3 commits intoNousResearch:mainfrom
kshitijk4poor wants to merge 3 commits intoNousResearch:mainfrom
Conversation
Introduce a shared helper for token pricing, cost estimation, and compact usage formatting so the CLI and insights command can reuse the same logic.
Route insights cost and duration helpers through the shared pricing module so pricing behavior stays consistent across CLI surfaces.
Surface model, context usage, cost, and elapsed time directly in the interactive CLI and expand /usage with a clearer session cost breakdown.
teknium1
pushed a commit
that referenced
this pull request
Mar 16, 2026
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)
Contributor
|
Merged via PR #1522. Your three commits were cherry-picked onto current main with authorship preserved. Salvage fixes applied:
Everything else carried over as-is: the status bar, usage_pricing module, enhanced /usage, and all tests. Nice work on this — the responsive layout and zero-priced-model handling are solid. |
teknium1
added a commit
that referenced
this pull request
Mar 16, 2026
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) 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
/usageand/insightsso cost and duration formatting stay consistent across CLI surfacesn/aPOC:

Test Plan
source /Users/kshitij/Projects/hermes-agent/.venv/bin/activate && python -m pytest -o addopts='' tests/test_cli_status_bar.py tests/test_insights.py tests/test_cli_init.py tests/test_cli_loading_indicator.py tests/test_resume_display.py -qsource /Users/kshitij/Projects/hermes-agent/.venv/bin/activate && python -m hermes_cli.main chat -q \"What tools do you have available?\"source /Users/kshitij/Projects/hermes-agent/.venv/bin/activate && python -m pytest -o addopts='' tests/ -q(3221 passed, 154 skipped, 2 pre-existing failures already reproducible on upstream/main:tests/test_cli_provider_resolution.py::test_codex_provider_uses_config_model,tests/test_real_interrupt_subagent.py::TestRealSubagentInterrupt::test_interrupt_child_during_api_call)Closes #683.