fix(agents): classify "Failed to extract accountId from token" as auth error for failover (#27055) (#55206)

Co-authored-by: Lyle Hopkins <55105+cosmicnet@users.noreply.github.com>
This commit is contained in:
Lyle Hopkins 2026-03-26 20:42:38 +00:00 committed by GitHub
parent 53d3b8e92d
commit eb328a85e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,7 @@ Docs: https://docs.openclaw.ai
- Agents/sandbox: make blocked-tool guidance glob-aware again, redact/sanitize session-specific explain hints for safer copy-paste, and avoid leaking control-character session keys in those hints. (#54684) Thanks @ngutman.
- Agents/compaction: trigger timeout recovery compaction before retrying high-context LLM timeouts so embedded runs stop repeating oversized requests. (#46417) thanks @joeykrug.
- Agents/compaction: reconcile `sessions.json.compactionCount` after a late embedded auto-compaction success so persisted session counts catch up once the handler reports completion. (#45493) Thanks @jackal092927.
- Agents/failover: classify Codex accountId token extraction failures as auth errors so model fallback continues to the next configured candidate. (#55206) Thanks @cosmicnet.
## 2026.3.24

View File

@ -104,6 +104,7 @@ describe("isAuthErrorMessage", () => {
"No API key found for profile openai.",
"OAuth token refresh failed for anthropic: Failed to refresh OAuth token for anthropic. Please try again or re-authenticate.",
"Please re-authenticate to continue.",
"Failed to extract accountId from token",
])("matches auth errors for %j", (sample) => {
expect(isAuthErrorMessage(sample)).toBe(true);
});

View File

@ -91,6 +91,7 @@ const ERROR_PATTERNS = {
/\b403\b/,
"no credentials found",
"no api key found",
/\bfailed to (?:extract|parse|validate|decode)\b.*\btoken\b/,
],
format: [
"string should match pattern",