File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/** Handles /bash and ! shell command chat shortcuts. */
2+ import { truncateUtf16Safe } from "@openclaw/normalization-core/utf16-slice" ;
23import {
34 normalizeLowercaseStringOrEmpty ,
45 normalizeOptionalString ,
@@ -54,7 +55,7 @@ function formatSessionSnippet(sessionId: string) {
5455 if ( trimmed . length <= 12 ) {
5556 return trimmed ;
5657 }
57- return `${ trimmed . slice ( 0 , 8 ) } …` ;
58+ return `${ truncateUtf16Safe ( trimmed , 8 ) } …` ;
5859}
5960
6061function formatOutputBlock ( text : string ) {
Original file line number Diff line number Diff line change 55 resolveAcpThreadSessionDetailLines ,
66} from "@openclaw/acp-core/runtime/session-identifiers" ;
77import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce" ;
8+ import { truncateUtf16Safe } from "@openclaw/normalization-core/utf16-slice" ;
89import { getAcpSessionManager } from "../../../acp/control-plane/manager.js" ;
910import { resolveAcpSessionResolutionError } from "../../../acp/control-plane/manager.utils.js" ;
1011import {
@@ -787,7 +788,7 @@ async function runAcpSteer(params: {
787788 if ( event . text ) {
788789 output += event . text ;
789790 if ( output . length > ACP_STEER_OUTPUT_LIMIT ) {
790- output = `${ output . slice ( 0 , ACP_STEER_OUTPUT_LIMIT ) } …` ;
791+ output = `${ truncateUtf16Safe ( output , ACP_STEER_OUTPUT_LIMIT ) } …` ;
791792 }
792793 }
793794 } ,
You can’t perform that action at this time.
0 commit comments