Skip to content

feat(cli): persist resolved approval/clarify prompts in scrollback - #44702

Merged
teknium1 merged 1 commit into
mainfrom
fix/persist-modal-prompts-scrollback
Jun 12, 2026
Merged

feat(cli): persist resolved approval/clarify prompts in scrollback#44702
teknium1 merged 1 commit into
mainfrom
fix/persist-modal-prompts-scrollback

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Resolved approval and clarify prompts now leave a one-line record in CLI scrollback, so the question and the decision survive the panel repaint.

Requested on Discord: modal prompt panels (dangerous-command approval, clarify) live in the prompt_toolkit layout and vanish on the next repaint — afterwards there is no trace of what was asked or what the user chose.

Changes

  • cli.py: new _persist_prompt_summary() helper; called on approval resolution (⚠ Approval: <command> → allowed for session / denied / …) and clarify resolution (? Clarify: <question> → <answer>). Detail/outcome whitespace-collapsed and capped at 120 chars. Timeout paths already printed their own line.
  • cli.py + hermes_cli/config.py: display.persist_prompts config key (default true); set false to keep scrollback untouched.
  • tests/cli/test_cli_approval_ui.py: 4 new tests — approval summary, long-command truncation, config-off suppression, clarify summary.

Validation

Before After
Approve a dangerous command panel vanishes, no record ⚠ Approval: rm -rf /tmp/scratch → allowed for session
Answer a clarify question panel vanishes, no record ? Clarify: Pick a path? → B
display.persist_prompts: false no summary printed

tests/cli/test_cli_approval_ui.py: 22/22 passed.

Infographic

persist-prompts-scrollback

Loading
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.

2 participants