@linnlabs/linnkit 0.31.1 → 0.32.0

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.
@@ -8887,6 +8887,15 @@ var ToolNode = class {
8887
8887
  });
8888
8888
  return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8889
8889
  }
8890
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
8891
+ logger11.info("[ToolNode] \u5DE5\u5177\u6279\u6B21\u5DF2\u7ED3\u7B97\uFF0C\u6309 Host \u7B56\u7565\u76F4\u63A5 yield", {
8892
+ toolName: context.toolName,
8893
+ toolCallId: context.toolCallId,
8894
+ conversationId: context.conversationId,
8895
+ turnId: context.turnId
8896
+ });
8897
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8898
+ }
8890
8899
  return {
8891
8900
  kind: "route",
8892
8901
  nextNodeId: remainingCalls.length > 0 ? "tool" : "llm",
@@ -8969,6 +8978,9 @@ var ToolNode = class {
8969
8978
  if (fuse.shouldFuse && remainingCalls.length === 0) {
8970
8979
  throw createToolProtocolFuseError(fuse.nextCount, context.exec.error);
8971
8980
  }
8981
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
8982
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8983
+ }
8972
8984
  return {
8973
8985
  kind: "route",
8974
8986
  // 同一个 assistant.tool_calls batch 必须为每个 call 产出 tool_output。
@@ -9493,7 +9505,8 @@ function createHostToolCallBootstrap(input) {
9493
9505
  conversationId,
9494
9506
  turnId,
9495
9507
  history: [...input.history ?? [], decisionEvent],
9496
- pendingToolCalls: [toolCall]
9508
+ pendingToolCalls: [toolCall],
9509
+ ...input.completionMode === void 0 ? {} : { toolBatchCompletionMode: input.completionMode }
9497
9510
  }
9498
9511
  };
9499
9512
  }