mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
fix(cli): return bool (not None) when a destructive-slash confirmation is cancelled (#40583)
process_command() is typed -> bool, but the /clear, /new, and /undo cancel paths did a bare `return` (None) when _confirm_destructive_slash was declined, leaking None through the bool contract. Return True (command handled, keep the REPL alive) on cancel. Co-authored-by: yubingz <yubingz@users.noreply.github.com>
This commit is contained in:
parent
0507e4630d
commit
136dae779e
1 changed files with 3 additions and 3 deletions
6
cli.py
6
cli.py
|
|
@ -8850,7 +8850,7 @@ class HermesCLI:
|
|||
"The current conversation history will be discarded.",
|
||||
cmd_original=cmd_original,
|
||||
) is None:
|
||||
return
|
||||
return True # confirmation cancelled — command handled, keep REPL alive
|
||||
self.new_session(silent=True)
|
||||
_clear_output_history()
|
||||
# Clear terminal screen. Inside the TUI, Rich's console.clear()
|
||||
|
|
@ -8984,7 +8984,7 @@ class HermesCLI:
|
|||
"The current conversation history will be discarded.",
|
||||
cmd_original=cmd_original,
|
||||
) is None:
|
||||
return
|
||||
return True # confirmation cancelled — command handled, keep REPL alive
|
||||
self.new_session(title=title)
|
||||
elif canonical == "resume":
|
||||
self._handle_resume_command(cmd_original)
|
||||
|
|
@ -9027,7 +9027,7 @@ class HermesCLI:
|
|||
_undo_desc,
|
||||
cmd_original=cmd_original,
|
||||
) is None:
|
||||
return
|
||||
return True # confirmation cancelled — command handled, keep REPL alive
|
||||
self.undo_last(_undo_n)
|
||||
elif canonical == "branch":
|
||||
self._handle_branch_command(cmd_original)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue