fix: clear matched tool errors and dedupe reasoning end

This commit is contained in:
Vignesh Natarajan
2026-02-18 23:33:55 -08:00
committed by Vignesh
parent 221d50bc18
commit 0ff506140d
6 changed files with 87 additions and 4 deletions

View File

@@ -151,6 +151,7 @@ export function buildToolActionFingerprint(
if (action) {
parts.push(`action=${action}`);
}
let hasStableTarget = false;
for (const key of [
"path",
"filePath",
@@ -167,10 +168,14 @@ export function buildToolActionFingerprint(
const value = normalizeFingerprintValue(record?.[key]);
if (value) {
parts.push(`${key.toLowerCase()}=${value}`);
hasStableTarget = true;
}
}
const normalizedMeta = meta?.trim().replace(/\s+/g, " ").toLowerCase();
if (normalizedMeta) {
// Meta text often carries volatile details (for example "N chars").
// Prefer stable arg-derived keys for matching; only fall back to meta
// when no stable target key is available.
if (normalizedMeta && !hasStableTarget) {
parts.push(`meta=${normalizedMeta}`);
}
return parts.join("|");