diff --git a/src/gateway/live-agent-probes.test.ts b/src/gateway/live-agent-probes.test.ts index 70d077149ec..6bda311c3ff 100644 --- a/src/gateway/live-agent-probes.test.ts +++ b/src/gateway/live-agent-probes.test.ts @@ -19,7 +19,13 @@ describe("live-agent-probes", () => { it("accepts only cat for the shared image probe reply", () => { expect(() => assertLiveImageProbeReply("cat")).not.toThrow(); + expect(() => + assertLiveImageProbeReply( + "model metadata for `gpt-5.5` not found. defaulting to fallback metadata; this can degrade performance and cause issues.cat", + ), + ).not.toThrow(); expect(() => assertLiveImageProbeReply("horse")).toThrow("image probe expected 'cat'"); + expect(() => assertLiveImageProbeReply("caterpillar")).toThrow("image probe expected 'cat'"); }); it("builds a retryable cron prompt with provider-specific fallback wording", () => { diff --git a/src/gateway/live-agent-probes.ts b/src/gateway/live-agent-probes.ts index b7f0012064d..e4e45586e34 100644 --- a/src/gateway/live-agent-probes.ts +++ b/src/gateway/live-agent-probes.ts @@ -33,7 +33,7 @@ export function isClaudeLikeLiveAgent(raw: string): boolean { export function assertLiveImageProbeReply(text: string): void { const normalized = normalizeOptionalLowercaseString(text); - if (normalized !== "cat") { + if (normalized !== "cat" && !/(^|[^a-z])cat[.!?`'")\]]*$/.test(normalized ?? "")) { throw new Error(`image probe expected 'cat', got: ${normalized}`); } }