From f40d2e34bd5dccba89cca176de5774f6b90c56a8 Mon Sep 17 00:00:00 2001 From: "Zaf (via OpenClaw)" Date: Mon, 9 Mar 2026 22:35:10 +0000 Subject: [PATCH] Add HTTP 499 to transient error codes for model fallback 499 (Client Closed Request) is commonly returned by Anthropic during overload but was missing from TRANSIENT_HTTP_ERROR_CODES, so it didn't trigger model fallback. Fixes #41467 --- src/agents/pi-embedded-helpers/errors.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agents/pi-embedded-helpers/errors.ts b/src/agents/pi-embedded-helpers/errors.ts index 4cf347150bf..69203328c5e 100644 --- a/src/agents/pi-embedded-helpers/errors.ts +++ b/src/agents/pi-embedded-helpers/errors.ts @@ -1,5 +1,6 @@ import type { AssistantMessage } from "@mariozechner/pi-ai"; import type { OpenClawConfig } from "../../config/config.js"; +import type { FailoverReason } from "./types.js"; import { createSubsystemLogger } from "../../logging/subsystem.js"; import { formatSandboxToolPolicyBlockedMessage } from "../sandbox.js"; import { stableStringify } from "../stable-stringify.js"; @@ -13,7 +14,6 @@ import { isTimeoutErrorMessage, matchesFormatErrorPattern, } from "./failover-matches.js"; -import type { FailoverReason } from "./types.js"; export { isAuthErrorMessage, @@ -189,7 +189,7 @@ const HTTP_STATUS_PREFIX_RE = /^(?:http\s*)?(\d{3})\s+(.+)$/i; const HTTP_STATUS_CODE_PREFIX_RE = /^(?:http\s*)?(\d{3})(?:\s+([\s\S]+))?$/i; const HTML_ERROR_PREFIX_RE = /^\s*(?: