mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-05 08:33:10 +00:00
fix case where opencode wasn't retrying
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { APICallError, ModelMessage } from "ai"
|
||||
import { STATUS_CODES } from "http"
|
||||
import { unique } from "remeda"
|
||||
import type { JSONSchema } from "zod/v4/core"
|
||||
|
||||
@@ -318,19 +317,6 @@ export namespace ProviderTransform {
|
||||
)
|
||||
}
|
||||
|
||||
if (!error.responseBody || (error.statusCode && message !== STATUS_CODES[error.statusCode])) {
|
||||
return message
|
||||
}
|
||||
|
||||
try {
|
||||
const body = JSON.parse(error.responseBody)
|
||||
// try to extract common error message fields
|
||||
const errMsg = body.message || body.error
|
||||
if (errMsg && typeof errMsg === "string") {
|
||||
return `${message}: ${errMsg}`
|
||||
}
|
||||
} catch {}
|
||||
|
||||
return `${message}: ${error.responseBody}`
|
||||
return message
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user