From 36c145ad7d2fcdb10c231215dab1d2209ea2ecd5 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 6 Jun 2026 08:22:51 -0700 Subject: [PATCH] fix(cli): return bool (not None) when a destructive-slash confirmation is cancelled 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 bb11587562ffc..000778b750f85 100644 --- a/cli.py +++ b/cli.py @@ -8850,7 +8850,7 @@ def process_command(self, command: str) -> bool: "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 @@ def process_command(self, command: str) -> bool: "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 @@ def process_command(self, command: str) -> bool: _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)