Skip to content

Commit 0aea8b8

Browse files
committed
Don't retry when using claude subscription, for when you are out of quota
1 parent ff1076a commit 0aea8b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sdk/src/impl/llm.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ export async function* promptAiSdkStream(
216216
prompt: undefined,
217217
model: aiSDKModel,
218218
messages: convertCbToModelMessages(params),
219+
// When using Claude OAuth, disable retries so we can immediately fall back to Codebuff
220+
// backend on rate limit errors instead of retrying 4 times first
221+
...(isClaudeOAuth && { maxRetries: 0 }),
219222
providerOptions: getProviderOptions({
220223
...params,
221224
agentProviderOptions: params.agentProviderOptions,

0 commit comments

Comments
 (0)