Skip to content

fix(cli): make idle refresh_interval configurable, default 0 (no auto-scroll) - #49056

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-ccde4740
Jun 19, 2026
Merged

fix(cli): make idle refresh_interval configurable, default 0 (no auto-scroll)#49056
teknium1 merged 2 commits into
mainfrom
hermes/hermes-ccde4740

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

The classic CLI no longer fights terminal auto-scroll-on-output during idle. display.cli_refresh_interval now drives prompt_toolkit's refresh_interval, defaulting to 0 (disabled).

Root cause: commit 6724daa2c hardcoded refresh_interval=1.0 to keep the idle clock ticking. In non-fullscreen mode that repaints the UI every second, and emulators with "auto-scroll on output" (Xshell, iTerm2, Windows Terminal) snap the viewport to the bottom — so scrolling up to read history gets yanked back down.

Salvages #48312 by @OYLFLMH (the issue reporter), with the config-default test ported from @Elshayib's #48319. Fixes #48309.

Changes

  • cli.py: refresh_interval reads display.cli_refresh_interval (default 0).
  • hermes_cli/config.py: new display.cli_refresh_interval default 0.
  • tests/hermes_cli/test_config.py: assert the default is 0.
  • scripts/release.py: AUTHOR_MAP entry for the salvaged commit.

Validation

Before After
Default idle behavior (non-fullscreen) repaint every 1s → auto-scroll snaps to bottom no background repaint, viewport stays put
Opt back in (cli_refresh_interval: 1.0) n/a idle clock ticks again
tests/hermes_cli/test_config.py 101/101 pass
E2E (both loaders) default 0, opt-in 1.0 honored

Default 0 restores the pre-6724daa2c behavior for everyone; users who want the live idle clock set display.cli_refresh_interval: 1.0 in config.yaml.

Infographic

cli-idle-refresh-no-auto-scroll

OYLFLMH and others added 2 commits June 19, 2026 06:43
Commit 6724daa added refresh_interval=1.0 to keep the idle clock
ticking, but unconditional 1 Hz redraws in non-fullscreen prompt_toolkit
mode cause terminal emulators (Xshell, iTerm2, Windows Terminal) to
auto-scroll to the bottom on every tick — breaking scroll-up to read
history.

Drive it from display.cli_refresh_interval (0 = disabled, the default)
so users who want the ticking clock can opt in without affecting everyone.

Fixes: #48309
Related: 6724daa, 8972a15
Follow-up to the salvaged #48312 — adds the config-default test (ported
from #48319) and the AUTHOR_MAP entry for the cherry-picked commit.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-ccde4740 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 11064 on HEAD, 11061 on base (🆕 +3)

🆕 New issues (4):

Rule Count
invalid-argument-type 3
invalid-assignment 1
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`
tests/hermes_cli/test_config.py:965: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(i: SupportsIndex, /) -> str, (s: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[str]]` cannot be called with key of type `Literal["cli_refresh_interval"]` on object of type `list[str]`
tests/hermes_cli/test_config.py:965: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(i: SupportsIndex, /) -> Unknown, (s: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[Unknown]]` cannot be called with key of type `Literal["cli_refresh_interval"]` on object of type `list[Unknown]`
tests/hermes_cli/test_config.py:965: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["cli_refresh_interval"]` on object of type `str`

✅ Fixed issues (2):

Rule Count
unresolved-attribute 2
First entries
run_agent.py:2971: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`

Unchanged: 5789 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 19, 2026
@teknium1
teknium1 merged commit 1cc9157 into main Jun 19, 2026
35 checks passed
@teknium1
teknium1 deleted the hermes/hermes-ccde4740 branch June 19, 2026 14:06
teknium1 added a commit that referenced this pull request Jun 19, 2026
#49087)

PR #49056 set the default to 0, which reverts the #45592 idle-clock fix:
without a periodic invalidate, prompt_toolkit stops repainting the bottom
chrome during idle and the status bar goes stale/disappears after a turn.

Restore 1.0 as the default for everyone. The config knob stays — users on
emulators where the per-second redraw fights auto-scroll (#48309) can set
display.cli_refresh_interval: 0 to opt out.
xyshanren pushed a commit to xyshanren/hermes-agent-cn that referenced this pull request Jun 25, 2026
NousResearch#49087)

PR NousResearch#49056 set the default to 0, which reverts the NousResearch#45592 idle-clock fix:
without a periodic invalidate, prompt_toolkit stops repainting the bottom
chrome during idle and the status bar goes stale/disappears after a turn.

Restore 1.0 as the default for everyone. The config knob stays — users on
emulators where the per-second redraw fights auto-scroll (NousResearch#48309) can set
display.cli_refresh_interval: 0 to opt out.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
NousResearch#49087)

PR NousResearch#49056 set the default to 0, which reverts the NousResearch#45592 idle-clock fix:
without a periodic invalidate, prompt_toolkit stops repainting the bottom
chrome during idle and the status bar goes stale/disappears after a turn.

Restore 1.0 as the default for everyone. The config knob stays — users on
emulators where the per-second redraw fights auto-scroll (NousResearch#48309) can set
display.cli_refresh_interval: 0 to opt out.
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
NousResearch#49087)

PR NousResearch#49056 set the default to 0, which reverts the NousResearch#45592 idle-clock fix:
without a periodic invalidate, prompt_toolkit stops repainting the bottom
chrome during idle and the status bar goes stale/disappears after a turn.

Restore 1.0 as the default for everyone. The config knob stays — users on
emulators where the per-second redraw fights auto-scroll (NousResearch#48309) can set
display.cli_refresh_interval: 0 to opt out.
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
NousResearch#49087)

PR NousResearch#49056 set the default to 0, which reverts the NousResearch#45592 idle-clock fix:
without a periodic invalidate, prompt_toolkit stops repainting the bottom
chrome during idle and the status bar goes stale/disappears after a turn.

Restore 1.0 as the default for everyone. The config knob stays — users on
emulators where the per-second redraw fights auto-scroll (NousResearch#48309) can set
display.cli_refresh_interval: 0 to opt out.
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
NousResearch#49087)

PR NousResearch#49056 set the default to 0, which reverts the NousResearch#45592 idle-clock fix:
without a periodic invalidate, prompt_toolkit stops repainting the bottom
chrome during idle and the status bar goes stale/disappears after a turn.

Restore 1.0 as the default for everyone. The config knob stays — users on
emulators where the per-second redraw fights auto-scroll (NousResearch#48309) can set
display.cli_refresh_interval: 0 to opt out.
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
NousResearch#49087)

PR NousResearch#49056 set the default to 0, which reverts the NousResearch#45592 idle-clock fix:
without a periodic invalidate, prompt_toolkit stops repainting the bottom
chrome during idle and the status bar goes stale/disappears after a turn.

Restore 1.0 as the default for everyone. The config knob stays — users on
emulators where the per-second redraw fights auto-scroll (NousResearch#48309) can set
display.cli_refresh_interval: 0 to opt out.
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 type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: refresh_interval=1.0` causes terminal auto-scroll-to-bottom in non-fullscreen mode

3 participants