@@ -132,6 +132,16 @@ export abstract class LocalBaseRuntime implements Runtime {
132132 let timedOut = false ;
133133 let aborted = false ;
134134
135+ // Debug: log raw stdout/stderr from the child process
136+ let debugStdout = "" ;
137+ let debugStderr = "" ;
138+ childProcess . stdout ?. on ( "data" , ( chunk : Buffer ) => {
139+ debugStdout += chunk . toString ( ) ;
140+ } ) ;
141+ childProcess . stderr ?. on ( "data" , ( chunk : Buffer ) => {
142+ debugStderr += chunk . toString ( ) ;
143+ } ) ;
144+
135145 // Create promises for exit code and duration
136146 // Uses special exit codes (EXIT_CODE_ABORTED, EXIT_CODE_TIMEOUT) for expected error conditions
137147 const exitCode = new Promise < number > ( ( resolve , reject ) => {
@@ -140,6 +150,12 @@ export abstract class LocalBaseRuntime implements Runtime {
140150 // which causes hangs when users spawn background processes like servers.
141151 // The 'exit' event fires when the main bash process exits, which is what we want.
142152 childProcess . on ( "exit" , ( code ) => {
153+ log . info ( `[LocalBaseRuntime.exec] Process exited with code: ${ code } ` ) ;
154+ log . info ( `[LocalBaseRuntime.exec] stdout length: ${ debugStdout . length } ` ) ;
155+ log . info ( `[LocalBaseRuntime.exec] stdout: ${ debugStdout . substring ( 0 , 500 ) } ${ debugStdout . length > 500 ? "..." : "" } ` ) ;
156+ if ( debugStderr ) {
157+ log . info ( `[LocalBaseRuntime.exec] stderr: ${ debugStderr . substring ( 0 , 500 ) } ${ debugStderr . length > 500 ? "..." : "" } ` ) ;
158+ }
143159 // Clean up any background processes (process group cleanup)
144160 // This prevents zombie processes when scripts spawn background tasks
145161 if ( childProcess . pid !== undefined ) {
0 commit comments