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 INVALID_TOOL_CALL_IDS_FRAGMENT = "invalid tool call ids";
|
||||||
const APPROVAL_PENDING_DETAIL_FRAGMENT = "waiting for approval";
|
const APPROVAL_PENDING_DETAIL_FRAGMENT = "waiting for approval";
|
||||||
const CONVERSATION_BUSY_DETAIL_FRAGMENT =
|
const CONVERSATION_BUSY_DETAIL_FRAGMENT = "is currently being processed";
|
||||||
"another request is currently being processed";
|
|
||||||
const EMPTY_RESPONSE_DETAIL_FRAGMENT = "empty content in";
|
const EMPTY_RESPONSE_DETAIL_FRAGMENT = "empty content in";
|
||||||
const RETRYABLE_PROVIDER_DETAIL_PATTERNS = [
|
const RETRYABLE_PROVIDER_DETAIL_PATTERNS = [
|
||||||
"Anthropic API error",
|
"Anthropic API error",
|
||||||
|
|||||||
@@ -57,6 +57,14 @@ describe("isConversationBusyError", () => {
|
|||||||
).toBe(true);
|
).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", () => {
|
test("rejects approval-pending", () => {
|
||||||
expect(isConversationBusyError("The agent is waiting for approval")).toBe(
|
expect(isConversationBusyError("The agent is waiting for approval")).toBe(
|
||||||
false,
|
false,
|
||||||
|
|||||||
Reference in New Issue
Block a user