test(gateway): tolerate codex image probe diagnostics

This commit is contained in:
Peter Steinberger
2026-04-25 20:37:26 +01:00
parent a5a438a17c
commit 3593beee81
2 changed files with 7 additions and 1 deletions

View File

@@ -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", () => {

View File

@@ -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}`);
}
}