mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:50:49 +00:00
test: expand codex image fallback coverage (#65061) (thanks @zhulijin1991)
This commit is contained in:
@@ -4,17 +4,31 @@ import { __testing } from "./run-attempt.js";
|
||||
describe("Codex dynamic tool filtering", () => {
|
||||
it("drops the image tool when the model already has inbound vision input", () => {
|
||||
const toolNames = __testing
|
||||
.filterToolsForVisionInputs(
|
||||
[{ name: "image" }, { name: "read" }, { name: "write" }],
|
||||
{
|
||||
modelHasVision: true,
|
||||
hasInboundImages: true,
|
||||
},
|
||||
)
|
||||
.filterToolsForVisionInputs([{ name: "image" }, { name: "read" }, { name: "write" }], {
|
||||
modelHasVision: true,
|
||||
hasInboundImages: true,
|
||||
})
|
||||
.map((tool) => tool.name);
|
||||
|
||||
expect(toolNames).toContain("read");
|
||||
expect(toolNames).toContain("write");
|
||||
expect(toolNames).not.toContain("image");
|
||||
});
|
||||
|
||||
it("keeps the image tool unless both model vision and inbound images are present", () => {
|
||||
const tools = [{ name: "image" }, { name: "read" }];
|
||||
|
||||
expect(
|
||||
__testing.filterToolsForVisionInputs(tools, {
|
||||
modelHasVision: false,
|
||||
hasInboundImages: true,
|
||||
}),
|
||||
).toBe(tools);
|
||||
expect(
|
||||
__testing.filterToolsForVisionInputs(tools, {
|
||||
modelHasVision: true,
|
||||
hasInboundImages: false,
|
||||
}),
|
||||
).toBe(tools);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user