Bug Description
Running /new, /clear, /undo, or /reload-mcp mid-turn produces a RuntimeWarning:
RuntimeWarning: coroutine 'run_in_terminal.<locals>.run' was never awaited
The command still works (the confirmation prompt appears and input is accepted), but the warning is logged and the stack trace clutters output.
Steps to Reproduce
- Send a message that triggers a multi-turn agent run (e.g. "run a long build")
- While the spinner is active, type
/new
- Observe the confirmation prompt
- After selecting a choice, the RuntimeWarning appears in logs
Root Cause
_prompt_text_input() in cli.py calls run_in_terminal(_ask) without checking whether it's on the main thread. The sibling method _run_curses_picker() already has a threading.current_thread() is threading.main_thread() guard and falls back to a direct call when on a background thread.
When slash commands are dispatched from process_loop (which runs in a background thread), run_in_terminal returns a coroutine that can't be scheduled on the main event loop, producing the warning.
Affected Commands
All destructive slash commands that use _confirm_destructive_slash() → _prompt_text_input():
/new (and /reset)
/clear
/undo
Also /reload-mcp which uses _confirm_and_reload_mcp() → _prompt_text_input().
Environment
- Hermes version: main branch (May 2026)
- OS: Linux (WSL2 on Windows 11)
- Python: 3.11+
Bug Description
Running
/new,/clear,/undo, or/reload-mcpmid-turn produces aRuntimeWarning:The command still works (the confirmation prompt appears and input is accepted), but the warning is logged and the stack trace clutters output.
Steps to Reproduce
/newRoot Cause
_prompt_text_input()incli.pycallsrun_in_terminal(_ask)without checking whether it's on the main thread. The sibling method_run_curses_picker()already has athreading.current_thread() is threading.main_thread()guard and falls back to a direct call when on a background thread.When slash commands are dispatched from
process_loop(which runs in a background thread),run_in_terminalreturns a coroutine that can't be scheduled on the main event loop, producing the warning.Affected Commands
All destructive slash commands that use
_confirm_destructive_slash()→_prompt_text_input():/new(and/reset)/clear/undoAlso
/reload-mcpwhich uses_confirm_and_reload_mcp()→_prompt_text_input().Environment