Skip to content

Commit 68b9390

Browse files
committed
test(release): retry transient tool-read failures
1 parent 11b1658 commit 68b9390

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/gateway/gateway-models.profiles.live.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,10 +2225,14 @@ function isToolNonceProbeMiss(error: string): boolean {
22252225

22262226
function isTransientToolReadProbeErrorForLiveModel(error: string): boolean {
22272227
const msg = error.toLowerCase();
2228+
const isTransientProviderFailure =
2229+
msg.includes("unknown error occurred") ||
2230+
(msg.includes("ai service returned an internal error") &&
2231+
msg.includes("try again in a moment"));
22282232
return (
22292233
msg.includes("tool-read: agent-wait") &&
22302234
msg.includes("failovererror") &&
2231-
msg.includes("unknown error occurred")
2235+
isTransientProviderFailure
22322236
);
22332237
}
22342238

@@ -2294,11 +2298,21 @@ describe("isTransientToolReadProbeErrorForLiveModel", () => {
22942298
"[all-models] 1/1 google/gemini-3.1-pro-preview: tool-read: agent-wait: agent.wait error for runId=run-1 (error=FailoverError: An unknown error occurred)",
22952299
),
22962300
).toBe(true);
2301+
expect(
2302+
isTransientToolReadProbeErrorForLiveModel(
2303+
"[all-models] 1/1 openai/gpt-5.5: tool-read: agent-wait: agent.wait error for runId=run-1 (error=FailoverError: The AI service returned an internal error. Please try again in a moment.)",
2304+
),
2305+
).toBe(true);
22972306
expect(
22982307
isTransientToolReadProbeErrorForLiveModel(
22992308
"[all-models] 1/1 google/gemini-3.1-pro-preview: prompt: agent-wait: agent.wait error for runId=run-1 (error=FailoverError: An unknown error occurred)",
23002309
),
23012310
).toBe(false);
2311+
expect(
2312+
isTransientToolReadProbeErrorForLiveModel(
2313+
"[all-models] 1/1 openai/gpt-5.5: prompt: agent-wait: agent.wait error for runId=run-1 (error=FailoverError: The AI service returned an internal error. Please try again in a moment.)",
2314+
),
2315+
).toBe(false);
23022316
});
23032317
});
23042318

0 commit comments

Comments
 (0)