mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-09 22:31:08 +00:00
updated to fix no break condition on loop and to use the same number of retries and delay as the glama provider (for consistency)
Signed-off-by: James Barker <james@jcbdevelopment.co.uk>
This commit is contained in:
parent
9c480aaac2
commit
b85960ba2a
1 changed files with 4 additions and 3 deletions
|
|
@ -184,9 +184,9 @@ export class OpenRouterHandler implements ApiHandler, SingleCompletionHandler {
|
|||
}
|
||||
|
||||
// retry fetching generation details
|
||||
let retries = 0
|
||||
while (retries < 3) {
|
||||
await delay(500) // FIXME: necessary delay to ensure generation endpoint is ready
|
||||
let attempt = 0
|
||||
while (attempt++ < 10) {
|
||||
await delay(200) // FIXME: necessary delay to ensure generation endpoint is ready
|
||||
try {
|
||||
const response = await axios.get(`https://openrouter.ai/api/v1/generation?id=${genId}`, {
|
||||
headers: {
|
||||
|
|
@ -207,6 +207,7 @@ export class OpenRouterHandler implements ApiHandler, SingleCompletionHandler {
|
|||
totalCost: generation?.total_cost || 0,
|
||||
fullResponseText,
|
||||
} as OpenRouterApiStreamUsageChunk
|
||||
return
|
||||
} catch (error) {
|
||||
// ignore if fails
|
||||
console.error("Error fetching OpenRouter generation details:", error)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue