Skip to content

Commit 58b21c6

Browse files
committed
fix(ui-quick): use truncateUtf16Safe for settings source truncation
1 parent 3f2466c commit 58b21c6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ui/src/pages/config/quick.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from "../../app/user-identity.ts";
2121
import { icons } from "../../components/icons.ts";
2222
import { t } from "../../i18n/index.ts";
23+
import { truncateUtf16Safe } from "@openclaw/normalization-core/utf16-slice";
2324
import { formatBytes } from "../../lib/agents/display.ts";
2425
import { resolveAssistantTextAvatar, resolveChatAvatarRenderUrl } from "../../lib/avatar.ts";
2526
import { formatDurationHuman } from "../../lib/format.ts";
@@ -221,7 +222,7 @@ function formatAssistantAvatarSource(value: string | null | undefined): string |
221222
const header = source.slice(0, source.indexOf(",") > 0 ? source.indexOf(",") : 32);
222223
return `${header},...`;
223224
}
224-
return source.length > 72 ? `${source.slice(0, 34)}...${source.slice(-24)}` : source;
225+
return source.length > 72 ? `${truncateUtf16Safe(source, 34)}...${source.slice(-24)}` : source;
225226
}
226227

227228
function formatAssistantAvatarIssue(

0 commit comments

Comments
 (0)