Repository navigation
feat(cli): add display.status_bar.fields config for customizing status bar - #41995
liuhao1024 wants to merge 1 commit into
Conversation
…s bar Allow users to control which fields appear in the interactive CLI status bar via display.status_bar.fields in config.yaml. Available fields: model, context_pct, context_detail, compressions, bg_tasks, bg_processes, duration, prompt_elapsed, yolo, total_tokens. When the list is empty (default), all fields are shown as before. The field order is fixed (model always first); the config controls visibility only. Narrow terminals (<76 cols) automatically drop context_detail regardless of config. total_tokens is opt-in only (not shown by default) to avoid width overflow in the prompt_toolkit fragment renderer. Closes NousResearch#41909
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the configurable classic-CLI status bar. The requested setting is still absent from current main: cli.py:5063-5249 renders fixed fields without consulting configuration.
Problems
- The PR predates current status-bar fields. Current main renders background-subagent activity and idle time at
cli.py:5090-5092,5115-5124,5179-5181, and5222-5238; the proposed field set omits both. Preserve those defaults and expose them when porting this change. - This public config key needs documentation alongside the existing display settings at
website/docs/user-guide/configuration.md:1408-1485. - The new config comment says compact terminals drop compressions, while the PR's compact branch still renders configured compressions.
Suggested changes
- Salvage onto current
cli.py, add configurablebg_subagentsandidle_sincecoverage, and retain all current default fragments. - Document the setting and correct the compact-layout comment.
Automated hermes-sweeper review.
| if bg_count and _ok("bg_tasks"): | ||
| frags.append(_sep(sep_ch)) | ||
| frags.append(("class:status-bar-strong", f"▶ {bg_count}")) | ||
| bg_proc_count = snapshot.get("active_background_processes", 0) |
There was a problem hiding this comment.
Current main added the ⛓ background-subagent indicator after this PR's base (cli.py:4590, rendered at cli.py:5090-5092 and 5179-5181). Preserve it in the default layout and expose a corresponding configurable field when salvaging this branch.
| if prompt_elapsed and _ok("prompt_elapsed"): | ||
| frags.append(_sep(sep_ch)) | ||
| frags.append(("class:status-bar-dim", prompt_elapsed)) | ||
| if yolo_active and _ok("yolo"): |
There was a problem hiding this comment.
Current main also renders idle_since after the per-prompt timer (cli.py:5122-5124, 5235-5238). Add a field for it and retain the default rendering so a port does not drop the later idle-status feature.
| # listed fields appear (in order). Omit to keep the default set. | ||
| # Available: model, context_pct, context_detail, compressions, | ||
| # bg_tasks, bg_processes, duration, prompt_elapsed, yolo, total_tokens | ||
| # Narrow terminals (<76 cols) automatically drop context_detail and |
There was a problem hiding this comment.
This comment says compact terminals always drop compressions, but the PR's compact branch renders it when configured (cli.py:4154-4157). Align the comment with the implemented width behavior.
|
Heads-up: your fix has been salvaged onto current main in PR #92696 (your commit cherry-picked with authorship preserved, extended to the newer status-bar fields — bg_subagents, goal, idle_since, focus — plus the TUI fragments renderer parity, tests, and docs). It's awaiting maintainer review there. Thanks for the contribution! |
|
Thanks for salvaging this, @teknium1 — and for preserving the commit authorship. The extension to the newer fields ( Closing in favor of #92696. |
Problem
The CLI interactive status bar has a fixed set of fields (model, context %, compressions, background tasks, duration, etc.). Users cannot customize which fields appear — e.g., a user who doesn't care about compression counts or background process counts has no way to hide them, and there's no way to surface session token totals.
Issue #41909 requests a
display.status_bar.fieldsconfig option (mirroring the existingdisplay.runtime_footer.fieldspattern in the gateway).Solution
Add a
display.status_bar.fieldsconfig key that controls which fields are visible in the status bar.Config
Available fields
modelcontext_pctcontext_detailcompressionsbg_tasksbg_processesdurationprompt_elapsedyolototal_tokensExamples
Implementation
hermes_cli/config.py— Addeddisplay.status_bar.fieldswith default empty listcli.py— Added_get_status_bar_field_set()helper; modified_build_status_bar_text()and_get_status_bar_fragments()to check fields before rendering each segmenttests/cli/test_cli_status_bar.py— 11 new tests covering field filtering, default behavior, fragments, narrow terminal behavior, and total_tokens opt-inDesign decisions
context_detailregardless of config — there isn't enough space.total_tokensis opt-in only — it adds ~6 display-width chars that would push the fragment renderer over the 80-column limit in the default layout. Whenfieldsis empty (default),total_tokensis not shown.runtime_footer.fieldspattern — same config structure, same empty-means-defaults convention.Closes #41909