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:
@@ -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,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user