File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import fs from "node:fs/promises" ;
33import path from "node:path" ;
44import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce" ;
5+ import { truncateUtf16Safe } from "@openclaw/normalization-core/utf16-slice" ;
56import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js" ;
67import { normalizeEnvVarKey } from "../infra/host-env-security.js" ;
78import { parseStrictInteger , parseStrictPositiveInteger } from "../infra/parse-finite-number.js" ;
@@ -759,10 +760,12 @@ function formatLaunchctlResultDetail(res: {
759760 stderr : string ;
760761 code : number ;
761762} ) : string {
762- return sanitizeForLog ( ( res . stderr || res . stdout ) . replace ( / [ \r \n \t ] + / g, " " ) )
763- . replace ( / \s + / g, " " )
764- . trim ( )
765- . slice ( 0 , 1000 ) ;
763+ return truncateUtf16Safe (
764+ sanitizeForLog ( ( res . stderr || res . stdout ) . replace ( / [ \r \n \t ] + / g, " " ) )
765+ . replace ( / \s + / g, " " )
766+ . trim ( ) ,
767+ 1000 ,
768+ ) ;
766769}
767770
768771async function bootoutLaunchAgentOrThrow ( params : {
You can’t perform that action at this time.
0 commit comments