fix(qa): scope duplicate parity capture handling

This commit is contained in:
Peter Steinberger
2026-07-14 12:20:51 +01:00
parent 33e415ea6c
commit bac7744233
2 changed files with 13 additions and 4 deletions
@@ -13,6 +13,13 @@ describe("compareCapturedToolCallShape", () => {
expect(compareCapturedToolCallShape([call, call, call], [call, call])).toBeUndefined();
});
it("preserves execution count for non-image tools", () => {
const readCall = { tool: "read", argsHash: "same-args" };
expect(compareCapturedToolCallShape([readCall, readCall], [readCall])).toBe(
"tool call count differs (2 vs 1)",
);
});
it("preserves canonical execution count", () => {
expect(compareCapturedToolCallShape([call], [call, call])).toBe(
"tool call count differs (1 vs 2)",
+6 -4
View File
@@ -75,10 +75,12 @@ export function compareCapturedToolCallShape(
rightIndex += 1;
continue;
}
const knownShape = right.some(
(candidate) => candidate.tool === leftCall.tool && candidate.argsHash === leftCall.argsHash,
);
if (!knownShape) {
const duplicatedImageShape =
leftCall.tool === "image_generate" &&
right.some(
(candidate) => candidate.tool === leftCall.tool && candidate.argsHash === leftCall.argsHash,
);
if (!duplicatedImageShape) {
return exactMatch;
}
}