This repository was archived by the owner on May 15, 2026. It is now read-only.
Commit c5eb84b
Roo Code
fix(embeddings): add timeouts, 5xx retry, and proper error messages for OpenAI Compatible embedder
Fix critical issues where the OpenAI Compatible Embedder would hang indefinitely
on unresponsive servers and not retry 5xx server errors.
Changes:
- Add 60s timeout to OpenAI SDK constructor (timeout: 60000, maxRetries: 0)
- Add AbortController with 60s timeout to makeDirectEmbeddingRequest()
- Convert AbortError to HTTP 504 (Gateway Timeout)
- Extend retry logic to handle 5xx errors (500-599) with exponential backoff
- Update validation error messages:
- 429 -> rateLimitExceeded
- 502 -> badGateway (new)
- 503 -> serviceUnavailable
- 504 -> gatewayTimeout (new)
- Other 5xx -> serverError (was configurationError)
- Add i18n translations for new error messages in 17 languages
- Add unit tests for timeout handling and 5xx retry (5 new tests)
- Add unit tests for getErrorMessageForStatus (10 new tests)
Impact:
- All OpenAI-compatible embedders benefit (Gemini, Mistral, VercelAiGateway, OpenRouter)
- No breaking changes - existing functionality preserved
- Prevents infinite waits on unresponsive embedding servers
- Clear error messages for 502/503/504 errors
Files changed: 21
- 2 source files (openai-compatible.ts, validation-helpers.ts)
- 17 i18n locale files (en, ru, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, tr, vi, zh-CN, zh-TW)
- 3 test files (openai-compatible.spec.ts, openai.spec.ts, validation-helpers.spec.ts)
Test results:
- code-index tests: 482 passed, 0 failed
- All project tests: 8210 total (8154 passed, 57 skipped, 0 failed)
- Test files: 582 (569 run, 13 skipped)
- Duration: 4m44s1 parent 137d3f4 commit c5eb84b
23 files changed
Lines changed: 517 additions & 82 deletions
File tree
- src
- i18n/locales
- de
- en
- es
- fr
- hi
- id
- it
- ja
- ko
- nl
- pl
- pt-BR
- ru
- tr
- vi
- zh-CN
- zh-TW
- services/code-index
- embedders
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments