From 136dae779ec80b33c2ad823f0e9ec2f42435fdf9 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sun, 7 Jun 2026 02:49:28 -0700 Subject: [PATCH] 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 --- cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli.py b/cli.py index bb11587562f..000778b750f 100644 --- a/cli.py +++ b/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)