Skip to content

feat(cli): add display.status_bar.fields config for customizing status bar - #41995

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:feat/status-bar-field-config
Closed

liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:feat/status-bar-field-config

Conversation

@liuhao1024

Copy link
Copy Markdown

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.fields config option (mirroring the existing display.runtime_footer.fields pattern in the gateway).

Solution

Add a display.status_bar.fields config key that controls which fields are visible in the status bar.

Config

display:
  status_bar:
    fields: []  # empty = all defaults (backward compatible)

Available fields

Field Description
model Model short name (always first)
context_pct Context usage percentage
context_detail Context tokens used/total (wide terminals only, ≥76 cols)
compressions Compression count
bg_tasks Active background tasks
bg_processes Active background terminal processes
duration Session duration
prompt_elapsed Per-prompt elapsed timer
yolo YOLO mode indicator
total_tokens Session total tokens (opt-in only — not shown by default to avoid width overflow)

Examples

# Minimal: just model and duration
display:
  status_bar:
    fields: [model, duration]

# Power user: all fields including total tokens
display:
  status_bar:
    fields: [model, context_pct, context_detail, compressions, bg_tasks, bg_processes, duration, prompt_elapsed, yolo, total_tokens]

Implementation

  • hermes_cli/config.py — Added display.status_bar.fields with default empty list
  • cli.py — Added _get_status_bar_field_set() helper; modified _build_status_bar_text() and _get_status_bar_fragments() to check fields before rendering each segment
  • tests/cli/test_cli_status_bar.py — 11 new tests covering field filtering, default behavior, fragments, narrow terminal behavior, and total_tokens opt-in

Design decisions

  • Field order is fixed — the config controls which fields are visible, not their order. Model always comes first as the anchor. This avoids layout complexity and keeps the responsive width-based layout intact.
  • Narrow terminals (<76 cols) drop context_detail regardless of config — there isn't enough space.
  • total_tokens is opt-in only — it adds ~6 display-width chars that would push the fragment renderer over the 80-column limit in the default layout. When fields is empty (default), total_tokens is not shown.
  • Follows the runtime_footer.fields pattern — same config structure, same empty-means-defaults convention.

Closes #41909

…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
@alt-glitch alt-glitch added type/feature New feature or request comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 9, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and 5222-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 configurable bg_subagents and idle_since coverage, and retain all current default fragments.
  • Document the setting and correct the compact-layout comment.

Automated hermes-sweeper review.

Comment thread cli.py
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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cli.py
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"):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread hermes_cli/config.py
# 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

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!

@liuhao1024

Copy link
Copy Markdown
Author

Thanks for salvaging this, @teknium1 — and for preserving the commit authorship. The extension to the newer fields (bg_subagents, goal, idle_since, focus) and the TUI fragments renderer parity are exactly the parts that had drifted out of reach of this branch: it predates those fields, so its test (5) failure on the current matrix is just the stale-base artifact and not worth reworking here.

Closing in favor of #92696.

@liuhao1024 liuhao1024 closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom (and responsive) fields in the CLI status bar?

3 participants