tweak: add new ContextOverflowError type (#12777)

This commit is contained in:
Aiden Cline
2026-02-08 23:54:01 -06:00
committed by GitHub
parent d40dffb854
commit 99ea1351ce
6 changed files with 350 additions and 126 deletions
+3
View File
@@ -59,6 +59,9 @@ export namespace SessionRetry {
}
export function retryable(error: ReturnType<NamedError["toObject"]>) {
// DO NOT retry context overflow errors
if (MessageV2.ContextOverflowError.isInstance(error)) return undefined
if (MessageV2.APIError.isInstance(error)) {
if (!error.data.isRetryable) return undefined
return error.data.message.includes("Overloaded") ? "Provider is overloaded" : error.data.message