fix: error string matching for retry (#1487)
This commit is contained in:
@@ -15,8 +15,7 @@ import { isZaiNonRetryableError } from "../cli/helpers/zaiErrors";
|
||||
|
||||
const INVALID_TOOL_CALL_IDS_FRAGMENT = "invalid tool call ids";
|
||||
const APPROVAL_PENDING_DETAIL_FRAGMENT = "waiting for approval";
|
||||
const CONVERSATION_BUSY_DETAIL_FRAGMENT =
|
||||
"another request is currently being processed";
|
||||
const CONVERSATION_BUSY_DETAIL_FRAGMENT = "is currently being processed";
|
||||
const EMPTY_RESPONSE_DETAIL_FRAGMENT = "empty content in";
|
||||
const RETRYABLE_PROVIDER_DETAIL_PATTERNS = [
|
||||
"Anthropic API error",
|
||||
|
||||
@@ -57,6 +57,14 @@ describe("isConversationBusyError", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
test("detects busy error with run_id (run_id breaks old substring match)", () => {
|
||||
expect(
|
||||
isConversationBusyError(
|
||||
"Cannot send a new message: Another request (run_id=run-abc-123) is currently being processed for this conversation. Please wait for it to complete.",
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
test("rejects approval-pending", () => {
|
||||
expect(isConversationBusyError("The agent is waiting for approval")).toBe(
|
||||
false,
|
||||
|
||||
Reference in New Issue
Block a user