@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.
@@ -8817,6 +8817,15 @@ var ToolNode = class {
8817
8817
  });
8818
8818
  return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8819
8819
  }
8820
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
8821
+ logger11.info("[ToolNode] \u5DE5\u5177\u6279\u6B21\u5DF2\u7ED3\u7B97\uFF0C\u6309 Host \u7B56\u7565\u76F4\u63A5 yield", {
8822
+ toolName: context.toolName,
8823
+ toolCallId: context.toolCallId,
8824
+ conversationId: context.conversationId,
8825
+ turnId: context.turnId
8826
+ });
8827
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8828
+ }
8820
8829
  return {
8821
8830
  kind: "route",
8822
8831
  nextNodeId: remainingCalls.length > 0 ? "tool" : "llm",
@@ -8899,6 +8908,9 @@ var ToolNode = class {
8899
8908
  if (fuse.shouldFuse && remainingCalls.length === 0) {
8900
8909
  throw createToolProtocolFuseError(fuse.nextCount, context.exec.error);
8901
8910
  }
8911
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
8912
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8913
+ }
8902
8914
  return {
8903
8915
  kind: "route",
8904
8916
  // 同一个 assistant.tool_calls batch 必须为每个 call 产出 tool_output。
@@ -9423,7 +9435,8 @@ function createHostToolCallBootstrap(input) {
9423
9435
  conversationId,
9424
9436
  turnId,
9425
9437
  history: [...input.history ?? [], decisionEvent],
9426
- pendingToolCalls: [toolCall]
9438
+ pendingToolCalls: [toolCall],
9439
+ ...input.completionMode === void 0 ? {} : { toolBatchCompletionMode: input.completionMode }
9427
9440
  }
9428
9441
  };
9429
9442
  }