fix(model-fallback): retry forbidden provider errors

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Choi Kijin / 최 기진 / チョイ キジン
2026-04-28 15:29:33 +09:00
parent 613e4a6c12
commit 25548f2561
6 changed files with 59 additions and 29 deletions
+4 -4
View File
@@ -2,8 +2,8 @@ import type { FallbackEntry } from "./model-requirements"
import { readConnectedProvidersCache } from "./connected-providers-cache"
/**
* Error names that indicate a retryable model error (deadstop).
* These errors completely halt the action loop and should trigger fallback retry.
* Error names that indicate a retryable model error.
* These errors halt execution and should trigger fallback retry.
*/
const RETRYABLE_ERROR_NAMES = new Set([
"providermodelnotfounderror",
@@ -121,7 +121,7 @@ export interface ErrorInfo {
/**
* Determines if an error is a retryable model error.
* Returns true if the error is a known retryable type OR matches retryable message patterns.
* Returns true if it's a known retryable type OR matches retryable message patterns.
*/
export function isRetryableModelError(error: ErrorInfo): boolean {
// If we have an error name, check against known lists
@@ -156,7 +156,7 @@ export function isRetryableModelError(error: ErrorInfo): boolean {
/**
* Determines if an error should trigger a fallback retry.
* Returns true for deadstop errors that completely halt the action loop.
* Returns true for errors that halt execution.
*/
export function shouldRetryError(error: ErrorInfo): boolean {
return isRetryableModelError(error)