Skip to content

Commit b510535

Browse files
continue[bot]Continue
andcommitted
refactor: improve retry condition clarity
Make the retry logic more explicit by checking isLastAttempt instead of redundant comparison with OVERLOADED_RETRIES. This makes it clear that we retry on overloaded errors unless we're on the final attempt. Co-authored-by: nate <nate@continue.dev> Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev>
1 parent 8b97c16 commit b510535

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gui/src/redux/thunks/streamThunkWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const streamThunkWrapper = createAsyncThunk<
4242
const { parsedError, statusCode, message, modelTitle, providerName } =
4343
analyzeError(e, selectedModel);
4444

45-
const shouldRetry =
46-
isOverloadedErrorMessage(message) && attempt < OVERLOADED_RETRIES;
45+
const isLastAttempt = attempt === OVERLOADED_RETRIES;
46+
const shouldRetry = isOverloadedErrorMessage(message) && !isLastAttempt;
4747

4848
if (shouldRetry) {
4949
await dispatch(cancelStream());

0 commit comments

Comments
 (0)