File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -279,8 +279,9 @@ export class Run {
279
279
if ( this . process && this . process . stdio ) {
280
280
const pipe = this . process . stdio [ this . process . stdio . length - 1 ]
281
281
if ( pipe ) {
282
+ let frag = ""
282
283
pipe . on ( "data" , ( data : any ) => {
283
- this . emitEvent ( data . toString ( ) )
284
+ frag = this . emitEvent ( frag + data . toString ( ) )
284
285
} )
285
286
} else {
286
287
console . error ( "Failed to get event stream" )
@@ -357,7 +358,7 @@ export class Run {
357
358
}
358
359
359
360
const out = data as ChatState
360
- if ( out . done !== undefined && ! out . done ) {
361
+ if ( out . done === undefined || ! out . done ) {
361
362
this . chatState = JSON . stringify ( out . state )
362
363
this . state = RunState . Continue
363
364
} else {
@@ -458,7 +459,7 @@ export class Run {
458
459
if ( e . stderr ) {
459
460
this . stderr = ( this . stderr || "" ) + ( typeof e . stderr === "string" ? e . stderr : JSON . stringify ( e . stderr ) )
460
461
} else if ( e . stdout ) {
461
- this . processStdout ( e . stdout )
462
+ frag = this . processStdout ( e . stdout )
462
463
} else {
463
464
frag = this . emitEvent ( c )
464
465
}
You can’t perform that action at this time.
0 commit comments