fix: enable runtime fallback for delegated child sessions (#2357)

This commit is contained in:
YeonGyu-Kim
2026-03-12 01:43:17 +09:00
parent 4ded45d14c
commit ba86ef0eea
14 changed files with 630 additions and 211 deletions
+11 -1
View File
@@ -58,6 +58,11 @@ export function extractErrorName(error: unknown): string | undefined {
return directName
}
const dataName = (errorObj.data as Record<string, unknown> | undefined)?.name
if (typeof dataName === "string" && dataName.length > 0) {
return dataName
}
const nestedError = errorObj.error as Record<string, unknown> | undefined
const nestedName = nestedError?.name
if (typeof nestedName === "string" && nestedName.length > 0) {
@@ -78,6 +83,7 @@ export function classifyErrorType(error: unknown): string | undefined {
const errorName = extractErrorName(error)?.toLowerCase()
if (
errorName?.includes("ai_loadapikeyerror") ||
errorName?.includes("loadapi") ||
(/api.?key.?is.?missing/i.test(message) && /environment variable/i.test(message))
) {
@@ -88,7 +94,11 @@ export function classifyErrorType(error: unknown): string | undefined {
return "invalid_api_key"
}
if (errorName?.includes("unknownerror") && /model\s+not\s+found/i.test(message)) {
if (
errorName?.includes("providermodelnotfounderror") ||
errorName?.includes("modelnotfounderror") ||
(errorName?.includes("unknownerror") && /model\s+not\s+found/i.test(message))
) {
return "model_not_found"
}