mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:40:44 +00:00
test(gateway): tolerate codex image probe diagnostics
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user