failover: classify AbortError / stream-abort messages as timeout (#58315)#58324
Conversation
Greptile SummaryThis PR adds two regex patterns to the
Confidence Score: 5/5Safe to merge — minimal, targeted change with no logic regressions or false-positive risk from the new patterns. Both new regex patterns are well-bounded by \b word anchors, follow the established convention in the file, and are exercised by comprehensive new test cases. The priority ordering in classifyFailoverReason ensures higher-specificity classifiers (billing, auth, server errors) still take precedence. No P0 or P1 findings were identified. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/agents/pi-embedded-helpers/failover-matches.ts | Two new timeout regex patterns added with proper word-boundary anchors; follows existing conventions and does not affect higher-priority classifiers. |
| src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts | New test block covers all AbortError/stream-abort message variants using the established expectTimeoutFailoverSamples helper. |
Reviews (1): Last reviewed commit: "failover: classify AbortError and stream..." | Re-trigger Greptile
b370253 to
847f1a3
Compare
This comment was marked as spam.
This comment was marked as spam.
847f1a3 to
bc5b467
Compare
2f96c63 to
0531b64
Compare
0531b64 to
d8412f2
Compare
|
Merged via squash.
Thanks @yelog! |
…nclaw#58315) (openclaw#58324) Merged via squash. Prepared head SHA: d8412f2 Co-authored-by: yelog <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…nclaw#58315) (openclaw#58324) Merged via squash. Prepared head SHA: d8412f2 Co-authored-by: yelog <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…nclaw#58315) (openclaw#58324) Merged via squash. Prepared head SHA: d8412f2 Co-authored-by: yelog <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…nclaw#58315) (openclaw#58324) Merged via squash. Prepared head SHA: d8412f2 Co-authored-by: yelog <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…nclaw#58315) (openclaw#58324) Merged via squash. Prepared head SHA: d8412f2 Co-authored-by: yelog <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
…nclaw#58315) (openclaw#58324) Merged via squash. Prepared head SHA: d8412f2 Co-authored-by: yelog <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Summary
reason=unknownin model fallback logs instead ofreason=timeoutAbortErrorwhose message ("The operation was aborted","stream closed", etc.) did not match any existing timeout patternChanges
timeouterror patterns infailover-matches.ts:/\boperation was aborted\b/i— matches Node.js/undiciAbortErrormessages/\bstream (?:was )?(?:closed|aborted)\b/i— matches stream abort/close messagesThis is a pattern-level fix that benefits all providers (not just Ollama) where a stream abort produces a flattened error message that passes through
classifyFailoverReason.Closes #58315