mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
fix (agents): classify empty-chunk stream failures as timeout
This commit is contained in:
@@ -480,6 +480,10 @@ export function formatAssistantErrorText(
|
||||
return transientCopy;
|
||||
}
|
||||
|
||||
if (isTimeoutErrorMessage(raw)) {
|
||||
return "LLM request timed out.";
|
||||
}
|
||||
|
||||
if (isBillingErrorMessage(raw)) {
|
||||
return formatBillingErrorMessage(opts?.provider);
|
||||
}
|
||||
@@ -568,7 +572,13 @@ const ERROR_PATTERNS = {
|
||||
"usage limit",
|
||||
],
|
||||
overloaded: [/overloaded_error|"type"\s*:\s*"overloaded_error"/i, "overloaded"],
|
||||
timeout: ["timeout", "timed out", "deadline exceeded", "context deadline exceeded"],
|
||||
timeout: [
|
||||
"timeout",
|
||||
"timed out",
|
||||
"deadline exceeded",
|
||||
"context deadline exceeded",
|
||||
/without sending (?:any )?chunks?/i,
|
||||
],
|
||||
billing: [
|
||||
/["']?(?:status|code)["']?\s*[:=]\s*402\b|\bhttp\s*402\b|\berror(?:\s+code)?\s*[:=]?\s*402\b|\b(?:got|returned|received)\s+(?:a\s+)?402\b|^\s*402\s+payment/i,
|
||||
"payment required",
|
||||
|
||||
Reference in New Issue
Block a user