Skip to content

feat(cli): wrap /compress in _busy_command to block input during compression#15388

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-73a33188
Apr 24, 2026
Merged

feat(cli): wrap /compress in _busy_command to block input during compression#15388
teknium1 merged 1 commit into
mainfrom
hermes/hermes-73a33188

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

/compress now blocks the CLI input prompt while compression is in-flight, so keystrokes typed during compaction don't land in the next prompt.

Changes

  • cli.py::_manual_compress: wrap the try/except body in with self._busy_command('Compressing context...'):

Attribution

Salvage of #10303 by @iRonin — authorship preserved via cherry-pick. The _compressing flag added to run_agent.py in the original PR was dropped: it was set in three spots but read nowhere (not by cli.py, not by run_agent.py, not by the Ink TUI which uses a separate prompt path). The only load-bearing change is the one-line _busy_command wrap.

Validation

scripts/run_tests.sh tests/cli/ tests/hermes_cli/ -k 'compress or busy' → 33 passed
py_compile cli.py → ok

Closes #10303.

…ression

Before this, typing during /compress was accepted by the classic CLI
prompt and landed in the next prompt after compression finished,
effectively consuming a keystroke for a prompt that was about to be
replaced. Wrapping the body in self._busy_command('Compressing
context...') blocks input rendering for the duration, matching the
pattern /skills install and other slow commands already use.

Salvages the useful part of #10303 (@iRonin). The `_compressing` flag
added to run_agent.py in the original PR was dead code (set in 3 spots,
read nowhere — not by cli.py, not by run_agent.py, not by the Ink TUI
which doesn't use _busy_command at all) and was dropped.
@teknium1 teknium1 merged commit fd3864d into main Apr 24, 2026
9 of 12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-73a33188 branch April 24, 2026 22:21
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 24, 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 type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants