feat(FN-955): add 'request was aborted' to transient error patterns

- Add /request was aborted/i pattern to TRANSIENT_ERROR_PATTERNS for AI provider abort errors
- Cover case-insensitive matching (e.g., Anthropic streaming aborts)
- Add tests for positive matches, negative cases (bare 'abort'), and classifyError behavior
- Ensure abort errors classify as 'transient', not 'usage-limit'
This commit is contained in:
gsxdsm
2026-04-04 21:36:07 -07:00
parent 31df9ee1dc
commit e8e77ec234
2 changed files with 23 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ import { isUsageLimitError } from "./usage-limit-detector.js";
* - Timeouts (ETIMEDOUT, timeout in connection context)
* - Socket errors (socket hang up)
* - Transport layer failures
* - AI provider abort errors (request was aborted — temporary streaming/API cancellations)
*/
export const TRANSIENT_ERROR_PATTERNS: RegExp[] = [
// Proxy/gateway errors - indicate temporary routing issues
@@ -47,6 +48,10 @@ export const TRANSIENT_ERROR_PATTERNS: RegExp[] = [
// Timeout patterns (only when related to connections, not general timeouts)
/timeout.*connection/i,
/connection.*timeout/i,
// AI provider abort errors — temporary request cancellations (e.g., Anthropic streaming aborts)
// These occur when the provider's infrastructure drops an in-flight request.
/request was aborted/i,
];
/**