mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
fix: synchronization between executed tools and turn loops (#488)
This commit is contained in:
parent
174fdce7d8
commit
a8bfdf2d56
4 changed files with 53 additions and 93 deletions
|
|
@ -383,6 +383,7 @@ export const useGeminiStream = (
|
|||
toolCallRequests.push(event.value);
|
||||
} else if (event.type === ServerGeminiEventType.UserCancelled) {
|
||||
handleUserCancelledEvent(userMessageTimestamp);
|
||||
cancel();
|
||||
return StreamProcessingStatus.UserCancelled;
|
||||
} else if (event.type === ServerGeminiEventType.Error) {
|
||||
handleErrorEvent(event.value, userMessageTimestamp);
|
||||
|
|
@ -393,12 +394,9 @@ export const useGeminiStream = (
|
|||
return StreamProcessingStatus.Completed;
|
||||
};
|
||||
|
||||
const streamingState: StreamingState = isResponding
|
||||
? StreamingState.Responding
|
||||
: pendingToolCalls?.tools.some(
|
||||
(t) => t.status === ToolCallStatus.Confirming,
|
||||
)
|
||||
? StreamingState.WaitingForConfirmation
|
||||
const streamingState: StreamingState =
|
||||
isResponding || toolCalls.some((t) => t.status === 'awaiting_approval')
|
||||
? StreamingState.Responding
|
||||
: StreamingState.Idle;
|
||||
|
||||
const submitQuery = useCallback(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue