mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(qa): scope duplicate parity capture handling
This commit is contained in:
@@ -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)",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user