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