Skip to content

feat: add CLI tab activity indicator - #36698

Open
JunYiTang wants to merge 6 commits into
NousResearch:mainfrom
JunYiTang:feat/cli-tab-activity-indicator
Open

feat: add CLI tab activity indicator#36698
JunYiTang wants to merge 6 commits into
NousResearch:mainfrom
JunYiTang:feat/cli-tab-activity-indicator

Conversation

@JunYiTang

Copy link
Copy Markdown

Summary

  • add an opt-in CLI tab title activity indicator for busy/done/idle states
  • expose display config for title templates and spinner frames
  • sanitize/truncate OSC title content and skip writes for non-TTY streams
  • add focused tests for opt-in behavior, TTY gating, sanitization, truncation, and invalid spinner config

Test Plan

  • venv/bin/python -m pytest tests/cli/test_cli_status_bar.py tests/cli/test_cli_background_status_indicator.py tests/cli/test_cli_tab_activity_indicator.py tests/hermes_cli/test_config*.py -q -o 'addopts='

Notes

  • The feature is disabled by default via display.tab_activity_indicator: false.

@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 1, 2026

@mxnstrexgl mxnstrexgl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Automated PR Review

Security Scan

  • ✓ No hardcoded secrets, injection sinks, unsafe deserialization, or dependency red flags found by this automated scan.

Code Quality

  • ✓ No blocking code-quality issues found by this automated scan.

Summary

Status: APPROVE — security findings: 0, quality suggestions: 0.

Automated review; raw diff content intentionally omitted.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the focused, opt-in classic-CLI implementation. The premise remains valid: current cli.py:5356-5362 and cli.py:11046-11073 update the in-terminal spinner/tool state but do not update a tab title. The existing Ink TUI has a related implementation at ui-tui/src/app/useMainApp.ts:572-582, but that does not provide the PR's classic-CLI config surface.

Problems

  • cli.py:3818 always writes OSC 0. Current terminal-title handling explicitly takes a Windows path at ui-tui/packages/hermes-ink/src/ink/hooks/use-terminal-title.ts:28-31 (process.title on win32) rather than relying on OSC. This PR needs equivalent classic-CLI Windows handling or an explicit unsupported-platform gate with coverage.

Suggested changes

  • Add a tested Windows-native title path (or platform gate) before salvage; preserve the existing TTY and sanitization behavior for OSC-capable terminals.

Automated hermes-sweeper review.

Comment thread cli.py Outdated
try:
if not (hasattr(stream, "isatty") and stream.isatty()):
return
stream.write(f"\033]0;{title}\a")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This emits OSC 0 on every platform. Current ui-tui/packages/hermes-ink/src/ink/hooks/use-terminal-title.ts:28-31 uses a dedicated win32 path instead of OSC; please add equivalent classic-CLI Windows handling (and coverage), or explicitly gate this feature where unsupported.

@teknium1 teknium1 added sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
@JunYiTang

Copy link
Copy Markdown
Author

Addressed the Windows title handling review in 338dd913e and refreshed the branch onto current main in b5d93ca2c.

  • On win32, the classic CLI now uses SetConsoleTitleW instead of emitting OSC 0.
  • On OSC-capable platforms, the existing raw-stream TTY gate, sanitization, truncation, deduplication, and patch_stdout bypass remain unchanged.
  • Added a Windows-path regression test that verifies the sanitized title reaches the native API and no OSC bytes are written.

Validation on the refreshed branch:

  • scripts/run_tests.sh for the tab-title, CLI status/background, and config suites: 273 passed.
  • Ruff on cli.py, hermes_cli/config.py, and tests/cli/test_cli_tab_activity_indicator.py: passed.

@YangKangSung

Copy link
Copy Markdown

Review note (overlap + Windows tab visibility)

Opt-in spinner templates are closer to a “status board” title than a static idle string — useful for multi-tab workflows.

Two notes from a Windows daily-driver angle:

  1. Overlap with feat(cli): show session state in classic terminal title #74654 / feat: terminal tab/window title with session name and thinking indicator #5505 — both touch classic-CLI title lifecycle. Worth maintainer consolidation so we don’t ship two config knobs (tab_activity_indicator vs terminal_title) that fight each other.

  2. Git Bash / VS Code tabsSetConsoleTitleW alone often doesn’t move mintty or VS Code integrated-terminal tab labels; those usually need OSC as well (dual-write). Your Win32 test is good for conhost; a manual matrix (WT / VS Code / mintty / conhost) would make salvage clearer.

Not blocking on the opt-in design itself.

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-platform-windows Sweeper risk: may break or behave differently on native Windows type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants