@@ -68,8 +68,8 @@ function resolveNativeUserHomeDir(): string | undefined {
6868}
6969
7070function resolveCompactHomePrefixes ( ) : string [ ] {
71- const homes = [ resolveUserHomeDir ( ) , resolveNativeUserHomeDir ( ) ] . filter (
72- ( home ) : home is string => Boolean ( home ) ,
71+ const homes = [ resolveUserHomeDir ( ) , resolveNativeUserHomeDir ( ) ] . filter ( ( home ) : home is string =>
72+ Boolean ( home ) ,
7373 ) ;
7474 const resolvedHomes = homes . map ( ( home ) => path . resolve ( home ) ) ;
7575 const realHomes = resolvedHomes
@@ -116,15 +116,15 @@ function resolvePromptTildeRoots(): string[] {
116116 return [ ] ;
117117 }
118118 const realNativeHome = tryRealpath ( resolvedNativeHome ) ;
119- return uniqueStrings ( [
120- resolvedNativeHome ,
121- ...( realNativeHome ? [ realNativeHome ] : [ ] ) ,
122- ] ) ;
119+ return uniqueStrings ( [ resolvedNativeHome , ...( realNativeHome ? [ realNativeHome ] : [ ] ) ] ) ;
123120}
124121
125122function isContainerStateHomeWherePromptTildeEscapes ( home : string ) : boolean {
126123 const configDir = path . resolve ( resolveConfigDir ( ) ) ;
127- return home === "/data" && ( configDir === "/data/.openclaw" || isPathInside ( "/data/.openclaw" , configDir ) ) ;
124+ return (
125+ home === "/data" &&
126+ ( configDir === "/data/.openclaw" || isPathInside ( "/data/.openclaw" , configDir ) )
127+ ) ;
128128}
129129
130130function shouldPreservePromptSkillPath (
@@ -1465,13 +1465,22 @@ function buildTruncationNote(params: {
14651465 const base = `${ prefix } ${ suffix } ` ;
14661466 const shortBase = `⚠️ Skills truncated: included ${ params . included } of ${ params . total } .` ;
14671467 const terse = "⚠️ Skills truncated." ;
1468- const baseNotice = formatNoticeWithinBudget ( [ base , shortBase , terse , "⚠️" ] , params . maxChars ) ;
1469- if ( ! baseNotice || baseNotice !== base ) {
1470- return baseNotice ;
1468+ const candidates = [
1469+ { prefix, suffix } ,
1470+ { prefix, suffix : "" } ,
1471+ ] ;
1472+ for ( const candidate of candidates ) {
1473+ const baseNotice = `${ candidate . prefix } ${ candidate . suffix } ` ;
1474+ if ( baseNotice . length > params . maxChars ) {
1475+ continue ;
1476+ }
1477+ const segmentBudget = params . maxChars - baseNotice . length ;
1478+ const omittedSegment = formatOmittedSkillKeysSegment ( params . omittedSkillKeys , segmentBudget ) ;
1479+ if ( omittedSegment ) {
1480+ return `${ candidate . prefix } ${ omittedSegment } ${ candidate . suffix } ` ;
1481+ }
14711482 }
1472- const segmentBudget = params . maxChars - base . length ;
1473- const omittedSegment = formatOmittedSkillKeysSegment ( params . omittedSkillKeys , segmentBudget ) ;
1474- return `${ prefix } ${ omittedSegment } ${ suffix } ` ;
1483+ return formatNoticeWithinBudget ( [ base , shortBase , terse , "⚠️" ] , params . maxChars ) ;
14751484}
14761485
14771486function buildCompactNote ( maxChars : number ) : string {
0 commit comments