@tanstack/ai 0.39.0 → 0.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import { stripToSpecMiddleware } from "../../strip-to-spec-middleware.js";
4
4
  import { streamToText } from "../../stream-to-response.js";
5
5
  import { resolveDebugOption } from "../../logger/resolve.js";
6
6
  import { normalizeToolResult } from "../../utilities/tool-result.js";
7
+ import { isProviderExecutedToolCall } from "../../utilities/provider-executed.js";
7
8
  import { LazyToolManager } from "./tools/lazy-tool-manager.js";
8
9
  import { ToolCallManager, MiddlewareAbortError, executeToolCalls } from "./tools/tool-calls.js";
9
10
  import { convertSchemaForStructuredOutput, isStandardSchema, parseWithStandardSchema, convertSchemaToJsonSchema } from "./tools/schema-converter.js";
@@ -1014,6 +1015,9 @@ class TextEngine {
1014
1015
  for (const message of this.messages) {
1015
1016
  if (message.role === "assistant" && message.toolCalls) {
1016
1017
  for (const toolCall of message.toolCalls) {
1018
+ if (isProviderExecutedToolCall(toolCall)) {
1019
+ continue;
1020
+ }
1017
1021
  if (!completedToolIds.has(toolCall.id)) {
1018
1022
  pending.push(toolCall);
1019
1023
  }