fix(scripts): keep prompt capture previews UTF-16 safe (#112044)

Use the shared UTF-16 truncation helper so captured Anthropic system and user prompt previews never emit dangling surrogate halves.
This commit is contained in:
Peter Steinberger
2026-07-20 20:58:06 -07:00
committed by GitHub
parent e679566a1c
commit bb45edac3e
+2 -1
View File
@@ -14,6 +14,7 @@ import os from "node:os";
import path from "node:path";
import process from "node:process";
import { pathToFileURL } from "node:url";
import { truncateUtf16Safe } from "@openclaw/normalization-core/utf16-slice";
import type { AuthProfileCredential } from "../src/agents/auth-profiles.js";
import {
parseBooleanEnv,
@@ -140,7 +141,7 @@ function summarizeText(text: string, max = 120): string {
if (normalized.length <= max) {
return normalized;
}
return `${normalized.slice(0, max - 1)}`;
return `${truncateUtf16Safe(normalized, max - 1)}`;
}
function summarizeCapture(