Skip to content

Commit

Permalink
Actually, early exit in retry on threads with no non-assistant messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
codeofdusk committed Feb 16, 2024
1 parent 1b20078 commit 2b8b10d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/gptcmd/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,7 @@ def do_retry(self, arg):
Resend up through the last non-assistant, non-sticky message to GPT.
This command takes no arguments.
"""
if not self._current_thread or (
len(self._current_thread) == 1
and self._current_thread[0].role == "assistant"
):
if not any(m.role != "assistant" for m in self._current_thread):
print("Nothing to retry!")
return
if self._current_thread != self._detached:
Expand Down

0 comments on commit 2b8b10d

Please sign in to comment.