fix: error string matching for retry (#1487)

This commit is contained in:
cthomas
2026-03-23 11:06:22 -07:00
committed by GitHub
parent 93a4567453
commit 1ff752ccc5
2 changed files with 9 additions and 2 deletions

View File

@@ -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",

View File

@@ -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,