fix(model-error-classifier): mark OpenAI server_error patterns as retryable (fixes #3799)
OpenAI streaming responses can surface mid-stream errors with type 'server_error' or with the prose message 'An error occurred while processing your request'. Neither matched any entry in RETRYABLE_MESSAGE_PATTERNS, so shouldRetryError returned false and the runtime-fallback / fallback-retry code paths skipped retry. The result was that GPT-5.5 subagent (and main) turns silently stalled until the stale timeout fired. The maintainer's diagnosis on issue #3799 explicitly recommends adding these two patterns to model-error-classifier.ts; this commit does exactly that and adds two regression tests covering the JSON envelope and the prose form.
This commit is contained in:
@@ -80,6 +80,11 @@ const RETRYABLE_MESSAGE_PATTERNS = [
|
||||
"请求过于频繁", // "too many requests"
|
||||
"暂时不可用", // "temporarily unavailable"
|
||||
"服务不可用", // "service unavailable"
|
||||
// OpenAI streaming server_error events surface either as a literal "server_error"
|
||||
// type or as the prose error sentence below. Without these patterns subagent
|
||||
// streams stall instead of being retried (issue #3799).
|
||||
"server_error",
|
||||
"an error occurred while processing",
|
||||
]
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user