fix: patch issue with state tool approval state

This commit is contained in:
cpacker
2025-11-04 15:50:16 -08:00
parent ceae108c1f
commit 42cd35aa1d

View File

@@ -85,15 +85,16 @@ export async function drainStream(
: null);
if (toolCall?.tool_call_id) {
// If this is a NEW tool call (different ID), reset accumulated state
if (toolCallId && toolCall.tool_call_id !== toolCallId) {
toolName = null;
toolArgs = null;
}
toolCallId = toolCall.tool_call_id;
}
if (toolCall?.name) {
if (toolName) {
// TODO would expect that we should allow stacking? I guess not?
// toolName = toolName + toolCall.name;
} else {
toolName = toolCall.name;
}
// Set the tool name (either first time or new tool call after reset)
toolName = toolCall.name;
}
if (toolCall?.arguments) {
if (toolArgs) {