Skip to content

Commit 1b20078

Browse files
committed
Fix edge case in retry (threads containing only one assistant message)
1 parent 1ad3d44 commit 1b20078

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gptcmd/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,10 @@ 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:
455+
if not self._current_thread or (
456+
len(self._current_thread) == 1
457+
and self._current_thread[0].role == "assistant"
458+
):
456459
print("Nothing to retry!")
457460
return
458461
if self._current_thread != self._detached:

0 commit comments

Comments
 (0)