You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Classify planner failures on the shapes providers actually emit
The recovery card's whole job is deciding whether a failure is fixed by
opening Providers or by retrying, and the first classifier got the two
most common browser cases backwards: Chrome's "Failed to fetch" and
Firefox's "NetworkError…" — what a stopped local provider looks like from
inside the extension — both fell through to `provider`, while a bare scan
for 5xx-shaped digits read "max_tokens 512" as a server error and led
with a Retry that could only fail the same way.
Status codes are now only trusted where they read as a status, textual
auth rejections ("Unauthorized", "invalid_api_key") are recognized
without a code, and a remaining 4xx stays `provider` because retrying an
argument the provider rejected is not the fix.
Also: carry `failureKind` through the planner gate wrapper, which was
dropping it before any caller could read it; name the failing provider in
the card, since "open Providers" is only actionable when the user knows
which one to look at; and end the detail sentence before appending "No
tools ran."
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
// "Failed to fetch" (Chrome) and "NetworkError…" (Firefox) are the shapes a
141
+
// dead local provider or an offline machine actually produces, so they have
142
+
// to land in the bucket that offers Retry first.
143
+
const PLANNER_TRANSIENT_FAILURE_RE = /\b(?:timed?\s*out|timeout|network\w*|failed to fetch|fetch failed|load failed|connection (?:closed|reset|refused|error)|econn\w+|socket hang up|temporar(?:y|ily)|unavailable|overloaded|rate[\s_-]?limit\w*|too many requests|bad gateway|gateway timeout)\b/i;
// "Failed to fetch" (Chrome) and "NetworkError…" (Firefox) are the shapes a
136
+
// dead local provider or an offline machine actually produces, so they have
137
+
// to land in the bucket that offers Retry first.
138
+
const PLANNER_TRANSIENT_FAILURE_RE = /\b(?:timed?\s*out|timeout|network\w*|failed to fetch|fetch failed|load failed|connection (?:closed|reset|refused|error)|econn\w+|socket hang up|temporar(?:y|ily)|unavailable|overloaded|rate[\s_-]?limit\w*|too many requests|bad gateway|gateway timeout)\b/i;
0 commit comments