File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -279,8 +279,9 @@ export class Run {
279279 if ( this . process && this . process . stdio ) {
280280 const pipe = this . process . stdio [ this . process . stdio . length - 1 ]
281281 if ( pipe ) {
282+ let frag = ""
282283 pipe . on ( "data" , ( data : any ) => {
283- this . emitEvent ( data . toString ( ) )
284+ frag = this . emitEvent ( frag + data . toString ( ) )
284285 } )
285286 } else {
286287 console . error ( "Failed to get event stream" )
@@ -357,7 +358,7 @@ export class Run {
357358 }
358359
359360 const out = data as ChatState
360- if ( out . done !== undefined && ! out . done ) {
361+ if ( out . done === undefined || ! out . done ) {
361362 this . chatState = JSON . stringify ( out . state )
362363 this . state = RunState . Continue
363364 } else {
@@ -458,7 +459,7 @@ export class Run {
458459 if ( e . stderr ) {
459460 this . stderr = ( this . stderr || "" ) + ( typeof e . stderr === "string" ? e . stderr : JSON . stringify ( e . stderr ) )
460461 } else if ( e . stdout ) {
461- this . processStdout ( e . stdout )
462+ frag = this . processStdout ( e . stdout )
462463 } else {
463464 frag = this . emitEvent ( c )
464465 }
You can’t perform that action at this time.
0 commit comments