fix(test): require native web search proof

This commit is contained in:
Vincent Koc
2026-06-07 00:02:29 +02:00
parent 2102166f86
commit 1b6bc2ef7d
2 changed files with 33 additions and 9 deletions
@@ -26,6 +26,7 @@ describe("openai web-search minimal assertions", () => {
reasoning: { effort: "low" },
tools: [{ type: "web_search" }],
},
method: "POST",
path: "/v1/responses",
})}\n`,
);
@@ -49,6 +50,7 @@ describe("openai web-search minimal assertions", () => {
reasoning: { effort: "low" },
tools: [{ type: "web_search" }],
},
method: "POST",
path: "/v1/responses",
},
)}\n`,
@@ -95,6 +97,7 @@ describe("openai web-search minimal assertions", () => {
input: `DO_NOT_DUMP_OLD_RESPONSE${"x".repeat(70 * 1024)}recent response tail`,
tools: [{ type: "web_search" }],
},
method: "POST",
path: "/v1/responses",
})}\n`,
);
@@ -109,4 +112,30 @@ describe("openai web-search minimal assertions", () => {
rmSync(dir, { force: true, recursive: true });
}
});
it("rejects function-shaped web_search as native Responses proof", () => {
const dir = mkdtempSync(path.join(tmpdir(), "openclaw-web-search-minimal-"));
try {
const logPath = path.join(dir, "requests.jsonl");
writeFileSync(
logPath,
`${JSON.stringify({
body: {
input: "OPENCLAW_SCHEMA_E2E_OK",
reasoning: { effort: "low" },
tools: [{ name: "web_search", type: "function" }],
},
method: "POST",
path: "/v1/responses",
})}\n`,
);
const result = runAssertSuccessRequest(logPath);
expect(result.status).not.toBe(0);
expect(result.stderr).toContain("success request did not include native web_search");
} finally {
rmSync(dir, { force: true, recursive: true });
}
});
});