hermes - ✅(Solved) Fix fix: /clear confirmation dialog renders as raw text in TUI mode [4 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#23155Fetched 2026-05-11 03:30:46
View on GitHub
Comments
0
Participants
1
Timeline
10
Reactions
0
Participants
Timeline (top)
cross-referenced ×5labeled ×4referenced ×1

Fix Action

Workaround

Users can disable the confirmation entirely:

hermes config set approvals.destructive_slash_confirm false

PR fix notes

PR #23173: fix(tui): route confirmation dialog through _cprint for TUI rendering

Description (problem / solution / changelog)

Problem

_confirm_destructive_slash() uses bare print() for its confirmation dialog, which renders as raw/invisible text inside the TUI. Raw print() output is swallowed by prompt_toolkit's patch_stdout StdoutProxy, so the confirmation prompt for /clear, /new, /reset, and /undo doesn't display correctly.

Fix

Replace all 15 print() calls in _confirm_destructive_slash() with _cprint(), which routes text through print_formatted_text(ANSI(...)) — the same TUI-aware output path used by the rest of the CLI.

No behavioral changes — same text, same prompt flow, same config gating.

Testing

  • Syntax check: python -m py_compile cli.py
  • Import verification: from cli import _cprint
  • Verified no bare print() calls remain in the method

Closes #23155

Changed files

  • cli.py (modified, +15/-15)
  • scripts/release.py (modified, +1/-0)

PR #23176: fix(tui): render destructive slash confirmations via cprint

Description (problem / solution / changelog)

What does this PR do?

Fixes the destructive slash confirmation dialog in TUI mode by routing the warning text through Hermes' prompt_toolkit-safe output path instead of raw print(). That keeps /clear, /new, /reset, and /undo confirmations rendered consistently inside the live TUI.

Related Issue

Fixes #23155

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Replace raw print() calls in HermesCLI._confirm_destructive_slash() with _cprint() so the dialog uses the TUI-safe render path
  • Route cancel / unknown-choice / opt-out feedback through the same output path for consistency
  • Add regression coverage in tests/cli/test_destructive_slash_confirm.py to assert TUI mode uses _cprint() and still preserves the existing confirmation behavior

How to Test

  1. UV_PYTHON=3.11 /Library/Frameworks/Python.framework/Versions/3.10/bin/uv run --frozen pytest -q -o addopts='' tests/cli/test_destructive_slash_confirm.py
  2. UV_PYTHON=3.11 /Library/Frameworks/Python.framework/Versions/3.10/bin/uv run --frozen ruff check cli.py tests/cli/test_destructive_slash_confirm.py
  3. In TUI mode, trigger /clear or /new and verify the confirmation text renders through the managed UI instead of appearing as raw terminal text

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.x

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

  • 8 passed in 1.00s
  • ruff check ... All checks passed!

Changed files

  • cli.py (modified, +17/-17)
  • tests/cli/test_destructive_slash_confirm.py (modified, +26/-0)

PR #23290: fix(cli): render /clear confirmation dialog via _cprint in TUI mode

Description (problem / solution / changelog)

Closes #23155

In TUI mode, bare print() calls in _confirm_destructive_slash() are swallowed by prompt_toolkit's patch_stdout StdoutProxy, causing the /clear (and /new /reset /undo) confirmation dialog to render as raw text overlaid on the TUI rather than through the proper ANSI renderer.

Replace all print() calls with _cprint(), which routes through print_formatted_text(ANSI(...)) so the dialog displays correctly inside the interactive chat loop.

Changed files

  • cli.py (modified, +15/-15)

PR #23341: fix(cli): route /clear confirmation dialog through TUI renderer

Description (problem / solution / changelog)

Replaces bare print() with _cprint() inside _confirm_destructive_slash() so the confirmation prompt renders correctly inside the prompt_toolkit TUI instead of leaking as raw plain text behind the composer.

Closes #23155

Changed files

  • cli.py (modified, +15/-15)
  • scripts/release.py (modified, +1/-0)

Code Example

print(f"⚠️  /{command} — destroys conversation state")
print()
for line in detail.splitlines():
    print(f"  {line}")
print()
print("  [1] Approve Once   — proceed this time only")
print("  [2] Always Approve — proceed and silence this prompt permanently")
print("  [3] Cancel         — keep current conversation")
print()
raw = self._prompt_text_input("Choice [1/2/3]: ")

---

hermes config set approvals.destructive_slash_confirm false
RAW_BUFFERClick to expand / collapse

Bug

_confirm_destructive_slash() uses bare print() for its confirmation dialog, which renders as raw/plain text inside the TUI (when self._app is active). Other slash commands use ChatConsole or _cprint() for proper rendering through prompt_toolkit's ANSI pipeline.

Affected commands

All four destructive slash commands go through this path:

  • /clear (line 6788)
  • /new / /reset (line 6916)
  • /undo (line 6939)

Location

cli.py:8367-8437_confirm_destructive_slash() method.

Current code

print(f"⚠️  /{command} — destroys conversation state")
print()
for line in detail.splitlines():
    print(f"  {line}")
print()
print("  [1] Approve Once   — proceed this time only")
print("  [2] Always Approve — proceed and silence this prompt permanently")
print("  [3] Cancel         — keep current conversation")
print()
raw = self._prompt_text_input("Choice [1/2/3]: ")

Expected behavior

Dialog should render through the same TUI-aware output path as other slash command output (e.g. ChatConsole or _cprint()), so it displays correctly inside the prompt_toolkit managed terminal.

Workaround

Users can disable the confirmation entirely:

hermes config set approvals.destructive_slash_confirm false

Suggested fix

Replace print() calls with ChatConsole (or _cprint) when self._app is active, similar to how /clear's post-confirmation output already uses ChatConsole (lines 6811-6843). The _prompt_text_input call should also be checked for TUI compatibility.

Environment

  • Hermes Agent: latest main (44cdf555a)
  • CLI mode (default)
  • Terminal: Linux (Arch), prompt_toolkit TUI

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Dialog should render through the same TUI-aware output path as other slash command output (e.g. ChatConsole or _cprint()), so it displays correctly inside the prompt_toolkit managed terminal.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING