Skip to content

fix: properly handle exponential backoff for rate limiting in embedders #7030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Aug 13, 2025

Summary

This PR fixes the exponential backoff issue with Mistral AI (and other OpenAI-compatible) embeddings where rate limit retries were not properly respecting exponential delays. Instead of waiting progressively longer between retries, all retry messages would appear simultaneously and then wait for the maximum delay (5 minutes).

Problem

When using Mistral AI's codestral embeddings with large repositories (>5200 chunks), the rate limiter would:

  • Log all retry messages at once (5s, 10s, 20s, 40s, 80s, 160s, 300s)
  • Jump directly to the maximum 5-minute delay
  • Not properly coordinate delays across parallel embedding requests

Solution

  • Improved global rate limit state management: Now properly coordinates retry delays across all concurrent requests
  • Fixed delay calculation: Takes into account both global consecutive errors and per-request attempt numbers
  • Added success callback: Resets consecutive error count when requests succeed
  • Sequential retry delays: Ensures exponential backoff delays are applied sequentially rather than all at once

Changes

  • Modified OpenAICompatibleEmbedder to properly handle rate limit state and calculate delays
  • Updated updateGlobalRateLimitState to return the calculated delay and consider both global and per-attempt delays
  • Added resetGlobalRateLimitOnSuccess to reset error counts on successful requests
  • Fixed test cases to match the new method signatures

Testing

  • All existing tests pass ✅
  • Rate limit specific tests pass ✅
  • Mistral embedder tests pass ✅

Fixes #7029


Important

Fixes exponential backoff handling for rate limiting in OpenAICompatibleEmbedder, ensuring sequential retry delays and improved global state management.

  • Behavior:
    • Fixes exponential backoff in OpenAICompatibleEmbedder for rate limiting, ensuring sequential retry delays.
    • Coordinates retry delays across concurrent requests, considering both global and per-request attempts.
    • Resets consecutive error count on successful requests.
  • Functions:
    • Modifies updateGlobalRateLimitState to calculate and return delay based on global and per-attempt errors.
    • Adds resetGlobalRateLimitOnSuccess to reset error counts on success.
  • Testing:
    • Updates test cases in openai-compatible-rate-limit.spec.ts to match new method signatures and behavior.
    • Ensures tests validate correct application of exponential backoff and rate limit handling.

This description was created by Ellipsis for ac17708. You can customize this summary. It will automatically update as commits are pushed.

- Fixed issue where multiple concurrent requests hitting rate limits would all log retry messages simultaneously
- Improved global rate limit state management to coordinate retry delays across parallel requests
- Added proper delay calculation that considers both global consecutive errors and per-request attempt numbers
- Added success callback to reset consecutive error count when requests succeed
- Ensures exponential backoff delays are applied sequentially rather than all at once

Fixes #7029
@roomote roomote bot requested review from mrubens, cte and jr as code owners August 13, 2025 00:15
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Aug 13, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 13, 2025
Copy link
Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed my own code. Found it suspiciously working. Must have been an accident.

@@ -294,6 +294,9 @@ export class OpenAICompatibleEmbedder implements IEmbedder {

const embeddings = response.data.map((item) => item.embedding as number[])

// Reset consecutive errors on success
await this.resetGlobalRateLimitOnSuccess()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition to reset the error count on success! However, I notice there's no explicit test case verifying this behavior. Could we add a test that confirms consecutive errors are properly reset after a successful request?

@@ -452,16 +456,47 @@ export class OpenAICompatibleEmbedder implements IEmbedder {

state.lastRateLimitError = now

// Calculate exponential backoff based on consecutive errors
// Calculate exponential backoff based on consecutive errors AND attempt number
// Use the maximum of the two to ensure proper backoff
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we improve this comment to explain why we take the maximum? For example: 'Use the maximum of the two to ensure proper backoff: Global delay ensures all requests respect the rate limit across the system, while attempt delay ensures individual requests back off appropriately. Taking the maximum prevents requests from bypassing the global rate limit.'

// Check if we're already in a rate limit period
if (state.isRateLimited && state.rateLimitResetTime > now) {
// Return the remaining wait time
return state.rateLimitResetTime - now
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a debug log here to help track when requests are reusing existing rate limit periods. This would be helpful for debugging rate limit issues in production.

const attemptExponentialDelay = Math.min(INITIAL_DELAY_MS * Math.pow(2, attemptNumber), maxDelay)

// Use the larger of the two delays
const exponentialDelay = Math.max(globalExponentialDelay, attemptExponentialDelay)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation of the delay calculation! Taking the maximum of global and attempt-based delays ensures proper coordination across concurrent requests.

// Trigger the updateGlobalRateLimitState method
await (embedder as any).updateGlobalRateLimitState(rateLimitError)
// Trigger the updateGlobalRateLimitState method with attempt number
await (embedder as any).updateGlobalRateLimitState(rateLimitError, 0)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good update to pass the attempt number. Could we add another test case that explicitly verifies the resetGlobalRateLimitOnSuccess behavior to ensure consecutive errors are properly reset after successful requests?

@sealad886
Copy link

sealad886 commented Aug 13, 2025

@roomote-agent For what it's worth, I've installed this from this PR's branch on my local VS Code, and it does not appear to have fixed the issue quite. Now, there doesn't appear to be any attempt to exponentially back off at all. Here's the Developer Tools Console log:

console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 1/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 1/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 4850ms (attempt 2/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 4775ms (attempt 1/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 4677ms (attempt 2/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 2/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 1/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 1/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
log.ts:460 ERR [Extension Host] OpenAI Compatible embedder error (attempt 3/3): Error: 429 status code (no body)
at t.generate (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/core/error.ts:96:14)
at kn.makeStatusError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:412:28)
at kn.makeRequest (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:633:24)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:266:18)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
error @ log.ts:460
error @ log.ts:565
error @ logService.ts:51
Dms @ remoteConsoleUtil.ts:58
$logExtensionHostMessage @ mainThreadConsole.ts:38
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] OpenAI Compatible embedder error (attempt 3/3): Error: 429 status code (no body)
at t.generate (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/core/error.ts:96:14)
at kn.makeStatusError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:412:28)
at kn.makeRequest (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:633:24)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:266:18)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
log.ts:460 ERR [Extension Host] [DirectoryScanner] Error processing batch (attempt 2) in workspace /Users/andrew/zzCoding-play/Roo-Code: Error: Failed to create embeddings after 3 attempts: HTTP 429 - 429 status code (no body)
at formatEmbeddingError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/shared/validation-helpers.ts:225:10)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:341:11)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
error @ log.ts:460
error @ log.ts:565
error @ logService.ts:51
Dms @ remoteConsoleUtil.ts:58
$logExtensionHostMessage @ mainThreadConsole.ts:38
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] [DirectoryScanner] Error processing batch (attempt 2) in workspace /Users/andrew/zzCoding-play/Roo-Code: Error: Failed to create embeddings after 3 attempts: HTTP 429 - 429 status code (no body)
at formatEmbeddingError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/shared/validation-helpers.ts:225:10)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:341:11)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 2/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 2/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 2/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 4999ms (attempt 2/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 4902ms (attempt 2/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
log.ts:460 ERR [Extension Host] OpenAI Compatible embedder error (attempt 3/3): Error: 429 status code (no body)
at t.generate (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/core/error.ts:96:14)
at kn.makeStatusError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:412:28)
at kn.makeRequest (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:633:24)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:266:18)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
error @ log.ts:460
error @ log.ts:565
error @ logService.ts:51
Dms @ remoteConsoleUtil.ts:58
$logExtensionHostMessage @ mainThreadConsole.ts:38
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] OpenAI Compatible embedder error (attempt 3/3): Error: 429 status code (no body)
at t.generate (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/core/error.ts:96:14)
at kn.makeStatusError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:412:28)
at kn.makeRequest (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:633:24)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:266:18)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
log.ts:460 ERR [Extension Host] [DirectoryScanner] Error processing batch (attempt 1) in workspace /Users/andrew/zzCoding-play/Roo-Code: Error: Failed to create embeddings after 3 attempts: HTTP 429 - 429 status code (no body)
at formatEmbeddingError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/shared/validation-helpers.ts:225:10)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:341:11)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
error @ log.ts:460
error @ log.ts:565
error @ logService.ts:51
Dms @ remoteConsoleUtil.ts:58
$logExtensionHostMessage @ mainThreadConsole.ts:38
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] [DirectoryScanner] Error processing batch (attempt 1) in workspace /Users/andrew/zzCoding-play/Roo-Code: Error: Failed to create embeddings after 3 attempts: HTTP 429 - 429 status code (no body)
at formatEmbeddingError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/shared/validation-helpers.ts:225:10)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:341:11)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
log.ts:460 ERR [Extension Host] OpenAI Compatible embedder error (attempt 3/3): Error: 429 status code (no body)
at t.generate (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/core/error.ts:96:14)
at kn.makeStatusError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:412:28)
at kn.makeRequest (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:633:24)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:266:18)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
error @ log.ts:460
error @ log.ts:565
error @ logService.ts:51
Dms @ remoteConsoleUtil.ts:58
$logExtensionHostMessage @ mainThreadConsole.ts:38
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] OpenAI Compatible embedder error (attempt 3/3): Error: 429 status code (no body)
at t.generate (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/core/error.ts:96:14)
at kn.makeStatusError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:412:28)
at kn.makeRequest (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/src/client.ts:633:24)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:266:18)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
log.ts:460 ERR [Extension Host] [DirectoryScanner] Error processing batch (attempt 2) in workspace /Users/andrew/zzCoding-play/Roo-Code: Error: Failed to create embeddings after 3 attempts: HTTP 429 - 429 status code (no body)
at formatEmbeddingError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/shared/validation-helpers.ts:225:10)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:341:11)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
error @ log.ts:460
error @ log.ts:565
error @ logService.ts:51
Dms @ remoteConsoleUtil.ts:58
$logExtensionHostMessage @ mainThreadConsole.ts:38
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] [DirectoryScanner] Error processing batch (attempt 2) in workspace /Users/andrew/zzCoding-play/Roo-Code: Error: Failed to create embeddings after 3 attempts: HTTP 429 - 429 status code (no body)
at formatEmbeddingError (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/shared/validation-helpers.ts:225:10)
at t._embedBatchWithRetries (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:341:11)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/openai-compatible.ts:153:25)
at t.createEmbeddings (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/embedders/mistral.ts:53:11)
at Z3e.processBatch (/Users/andrew/zCoding-final/vscode_dev/code-portable-data/extensions/rooveterinaryinc.roo-cline-3.25.12/services/code-index/processors/scanner.ts:389:28)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383
console.ts:137 [Extension Host] Rate limit hit, retrying in 5000ms (attempt 1/3)
Ims @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
C @ event.ts:1219
fire @ event.ts:1250
fire @ ipc.net.ts:652
l.onmessage @ localProcessExtensionHost.ts:383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

[BUG] When using Mistral AI codestral embeddings (free!) with large repo, the rate limiter doesn't properly respect exponential back off
3 participants