Skip to content

Commit 2b8b10d

Browse files
committed
Actually, early exit in retry on threads with no non-assistant messages.
1 parent 1b20078 commit 2b8b10d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/gptcmd/cli.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,7 @@ def do_retry(self, arg):
452452
Resend up through the last non-assistant, non-sticky message to GPT.
453453
This command takes no arguments.
454454
"""
455-
if not self._current_thread or (
456-
len(self._current_thread) == 1
457-
and self._current_thread[0].role == "assistant"
458-
):
455+
if not any(m.role != "assistant" for m in self._current_thread):
459456
print("Nothing to retry!")
460457
return
461458
if self._current_thread != self._detached:

0 commit comments

Comments
 (0)