Skip to content

Commit 53ed2ac

Browse files
committed
fix(pi): hash cut tool input by code unit
1 parent 206657b commit 53ed2ac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/provider-pi/src/server/mcpExtensionSource.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function toolInputSummary(input: unknown): string {
7272
text = String(input);
7373
}
7474
if (text.length <= 4_000) return text;
75-
const hash = NodeCrypto.createHash("sha256").update(text).digest("hex");
75+
const hash = NodeCrypto.createHash("sha256").update(text, "utf16le").digest("hex");
7676
return text.slice(0, 4_000) + "\\n... " + (text.length - 4_000) +
7777
" more characters not shown (sha256 " + hash + ")";
7878
}

0 commit comments

Comments
 (0)