don't show tool call start until permissions check done

This commit is contained in:
Nate 2025-07-25 10:31:09 -07:00
parent 248ff78216
commit 7c12d8eda1

View file

@ -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,