@@ -265,6 +265,7 @@ async function runQaCli(
265265 opts ?: { timeoutMs ?: number ; json ?: boolean ; env ?: NodeJS . ProcessEnv } ,
266266) {
267267 const stdout = createQaChildOutputCapture ( ) ;
268+ const stdoutTail = createQaChildOutputTail ( ) ;
268269 const stderr = createQaChildOutputTail ( ) ;
269270 const distEntryPath = path . join ( env . repoRoot , "dist" , "index.js" ) ;
270271 const nodeExecPath = await resolveQaNodeExecPath ( ) ;
@@ -281,11 +282,25 @@ async function runQaCli(
281282 const timeoutMs = resolveTimerTimeoutMs ( opts ?. timeoutMs , 60_000 ) ;
282283 const timeout = setTimeout ( ( ) => {
283284 signalQaCliProcessTree ( child , "SIGKILL" ) ;
285+ const stdoutText = formatQaChildOutputTail ( stdoutTail , "qa cli stdout" ) ;
286+ const stderrText = formatQaChildOutputTail ( stderr , "qa cli stderr" ) ;
287+ const diagnostics = [
288+ stdoutText ? `stdout:\n${ stdoutText } ` : "" ,
289+ stderrText ? `stderr:\n${ stderrText } ` : "" ,
290+ ]
291+ . filter ( Boolean )
292+ . join ( "\n" ) ;
284293 reject (
285- new QaSuiteInfraError ( "qa_cli_timeout" , `qa cli timed out: openclaw ${ args . join ( " " ) } ` ) ,
294+ new QaSuiteInfraError (
295+ "qa_cli_timeout" ,
296+ `qa cli timed out: openclaw ${ args . join ( " " ) } ${ diagnostics ? `\n${ diagnostics } ` : "" } ` ,
297+ ) ,
286298 ) ;
287299 } , timeoutMs ) ;
288- child . stdout . on ( "data" , ( chunk ) => appendQaChildOutput ( stdout , chunk ) ) ;
300+ child . stdout . on ( "data" , ( chunk ) => {
301+ appendQaChildOutput ( stdout , chunk ) ;
302+ appendQaChildOutputTail ( stdoutTail , chunk ) ;
303+ } ) ;
289304 child . stderr . on ( "data" , ( chunk ) => appendQaChildOutputTail ( stderr , chunk ) ) ;
290305 child . once ( "error" , ( error ) => {
291306 clearTimeout ( timeout ) ;
0 commit comments