File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,7 +177,17 @@ function runQwenPrompt(prompt) {
177177 child . on ( "close" , ( code ) => {
178178 clearTimeout ( timer ) ;
179179 if ( code !== 0 ) {
180- reject ( new Error ( stderr . trim ( ) || `Qwen exited with status ${ code } ` ) ) ;
180+ const stdout = Buffer . concat ( chunks ) . toString ( "utf8" ) ;
181+ const stdoutTrim = stdout . trim ( ) ;
182+ const stderrTrim = stderr . trim ( ) ;
183+ // Include both streams (truncated) to help diagnose OAuth/model/network issues.
184+ const stdoutShort = stdoutTrim . length > 2000 ? `${ stdoutTrim . slice ( 0 , 2000 ) } ...` : stdoutTrim ;
185+ const stderrShort = stderrTrim . length > 2000 ? `${ stderrTrim . slice ( 0 , 2000 ) } ...` : stderrTrim ;
186+ const detailParts = [ ] ;
187+ if ( stderrShort ) detailParts . push ( `stderr: ${ stderrShort } ` ) ;
188+ if ( stdoutShort ) detailParts . push ( `stdout: ${ stdoutShort } ` ) ;
189+ const detail = detailParts . join ( " | " ) ;
190+ reject ( new Error ( detail || `Qwen exited with status ${ code } ` ) ) ;
181191 return ;
182192 }
183193 resolve ( Buffer . concat ( chunks ) . toString ( "utf8" ) ) ;
You can’t perform that action at this time.
0 commit comments