@@ -125,21 +125,6 @@ vi.mock("../utils/with-timeout.js", () => ({
125125} ) ) ;
126126
127127import { ensureOnboardingPluginInstalled } from "./onboarding-plugin-install.js" ;
128- import { testing } from "./onboarding-plugin-install.test-support.js" ;
129-
130- describe ( "plugin install error summaries" , ( ) => {
131- it ( "keeps bounded terminal text UTF-16 well-formed" , ( ) => {
132- expect ( testing . summarizeInstallError ( `${ "x" . repeat ( 178 ) } 🚀tail` ) ) . toBe ( `${ "x" . repeat ( 178 ) } …` ) ;
133- } ) ;
134-
135- it ( "keeps copyable line breaks while bounding detailed installer output" , ( ) => {
136- expect ( testing . formatInstallErrorDetail ( "first\nsecond\tvalue" ) ) . toBe ( "first\nsecond\\tvalue" ) ;
137- const detailed = testing . formatInstallErrorDetail ( `start\n${ "x" . repeat ( 20_000 ) } ` ) ;
138- expect ( detailed ) . toContain ( "start\n" ) ;
139- expect ( detailed ) . toHaveLength ( 12_000 ) ;
140- expect ( detailed . endsWith ( "… (installer output truncated)" ) ) . toBe ( true ) ;
141- } ) ;
142- } ) ;
143128
144129function requireCapturedPrompt < T > ( captured : T | undefined ) : T {
145130 if ( ! captured ) {
@@ -1215,10 +1200,11 @@ describe("ensureOnboardingPluginInstalled", () => {
12151200
12161201 it ( "returns bounded multiline ClawHub failure detail to non-interactive callers" , async ( ) => {
12171202 const runtimeError = vi . fn ( ) ;
1203+ const summaryPrefix = "x" . repeat ( 178 ) ;
12181204 installPluginFromClawHub . mockResolvedValueOnce ( {
12191205 ok : false ,
12201206 code : "archive_integrity_mismatch" ,
1221- error : `first line\ n${ "x " . repeat ( 20_000 ) } ` ,
1207+ error : `Install failed: ${ summaryPrefix } 🚀tail\tvalue[31m\nsecond\tline\ n${ "y " . repeat ( 20_000 ) } ` ,
12221208 } ) ;
12231209
12241210 const result = await ensureOnboardingPluginInstalled ( {
@@ -1242,10 +1228,15 @@ describe("ensureOnboardingPluginInstalled", () => {
12421228 promptInstall : false ,
12431229 } ) ;
12441230
1245- expect ( result . error ) . toMatch ( / ^ f i r s t l i n e \n / ) ;
1231+ expect ( result . error ) . toMatch ( / ^ I n s t a l l f a i l e d : x { 178 } 🚀 t a i l / ) ;
1232+ expect ( result . error ) . toContain ( "\\tvalue" ) ;
1233+ expect ( result . error ) . toContain ( "\nsecond\\tline\n" ) ;
1234+ expect ( result . error ) . not . toContain ( "" ) ;
12461235 expect ( result . error ?. endsWith ( "\n… (installer output truncated)" ) ) . toBe ( true ) ;
12471236 expect ( result . error ?. length ) . toBe ( 12_000 ) ;
1248- expect ( readFirstMockCall ( runtimeError , "runtime.error" ) [ 0 ] ) . toHaveLength ( 203 ) ;
1237+ const runtimeMessage = String ( readFirstMockCall ( runtimeError , "runtime.error" ) [ 0 ] ) ;
1238+ expect ( runtimeMessage ) . toContain ( `${ summaryPrefix } …` ) ;
1239+ expect ( runtimeMessage ) . not . toContain ( "" ) ;
12491240 } ) ;
12501241
12511242 it ( "does not offer local installs when the workspace only has a spoofed .git marker" , async ( ) => {
0 commit comments