@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.
package/dist/cli.js CHANGED
@@ -8701,6 +8701,15 @@ var ToolNode = class {
8701
8701
  });
8702
8702
  return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8703
8703
  }
8704
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
8705
+ logger11.info("[ToolNode] \u5DE5\u5177\u6279\u6B21\u5DF2\u7ED3\u7B97\uFF0C\u6309 Host \u7B56\u7565\u76F4\u63A5 yield", {
8706
+ toolName: context.toolName,
8707
+ toolCallId: context.toolCallId,
8708
+ conversationId: context.conversationId,
8709
+ turnId: context.turnId
8710
+ });
8711
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8712
+ }
8704
8713
  return {
8705
8714
  kind: "route",
8706
8715
  nextNodeId: remainingCalls.length > 0 ? "tool" : "llm",
@@ -8783,6 +8792,9 @@ var ToolNode = class {
8783
8792
  if (fuse.shouldFuse && remainingCalls.length === 0) {
8784
8793
  throw createToolProtocolFuseError(fuse.nextCount, context.exec.error);
8785
8794
  }
8795
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
8796
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8797
+ }
8786
8798
  return {
8787
8799
  kind: "route",
8788
8800
  // 同一个 assistant.tool_calls batch 必须为每个 call 产出 tool_output。
@@ -9307,7 +9319,8 @@ function createHostToolCallBootstrap(input) {
9307
9319
  conversationId,
9308
9320
  turnId,
9309
9321
  history: [...input.history ?? [], decisionEvent],
9310
- pendingToolCalls: [toolCall]
9322
+ pendingToolCalls: [toolCall],
9323
+ ...input.completionMode === void 0 ? {} : { toolBatchCompletionMode: input.completionMode }
9311
9324
  }
9312
9325
  };
9313
9326
  }