mirror of https://github.com/buster-so/buster.git
Merge pull request #1202 from buster-so/dallin-bus-1984-final-response-still-being-cut-off
Fix: wait for deltas to finish then write
This commit is contained in:
commit
2e8ed0ecd1
|
@ -75,11 +75,13 @@ export function createDoneToolExecute(context: DoneToolContext, state: DoneToolS
|
|||
throw new Error('Tool call ID is required');
|
||||
}
|
||||
|
||||
const result = await processDone(state, state.toolCallId, context.messageId, context, input);
|
||||
|
||||
// Wait for all pending updates from delta/finish to complete before returning
|
||||
// CRITICAL: Wait for ALL pending updates from delta/finish to complete FIRST
|
||||
// This ensures execute's update is always the last one in the queue
|
||||
await waitForPendingUpdates(context.messageId);
|
||||
|
||||
// Now do the final authoritative update with the complete input
|
||||
const result = await processDone(state, state.toolCallId, context.messageId, context, input);
|
||||
|
||||
cleanupState(state);
|
||||
return result;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue