don't show tool call start until permissions check done
This commit is contained in:
parent
248ff78216
commit
7c12d8eda1
1 changed files with 7 additions and 7 deletions
|
|
@ -266,13 +266,8 @@ async function processStreamingResponse(
|
|||
try {
|
||||
toolCall.arguments = JSON.parse(toolCall.argumentsStr);
|
||||
|
||||
// Notify on first successful parse
|
||||
if (!toolCall.startNotified && toolCall.name) {
|
||||
toolCall.startNotified = true;
|
||||
if (callbacks?.onToolStart) {
|
||||
callbacks.onToolStart(toolCall.name, toolCall.arguments);
|
||||
}
|
||||
}
|
||||
// Don't notify onToolStart here anymore - wait until after permission check
|
||||
toolCall.startNotified = true;
|
||||
} catch (e) {
|
||||
// JSON not complete yet, continue
|
||||
}
|
||||
|
|
@ -532,6 +527,11 @@ export async function streamChatResponse(
|
|||
continue;
|
||||
}
|
||||
|
||||
// Now that permission is approved, notify tool start
|
||||
if (callbacks?.onToolStart) {
|
||||
callbacks.onToolStart(toolCall.name, toolCall.arguments);
|
||||
}
|
||||
|
||||
logger.debug("Executing tool", {
|
||||
name: toolCall.name,
|
||||
arguments: toolCall.arguments,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue