@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/testkit.cjs CHANGED
@@ -9071,6 +9071,15 @@ var ToolNode = class {
9071
9071
  });
9072
9072
  return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9073
9073
  }
9074
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
9075
+ logger11.info("[ToolNode] \u5DE5\u5177\u6279\u6B21\u5DF2\u7ED3\u7B97\uFF0C\u6309 Host \u7B56\u7565\u76F4\u63A5 yield", {
9076
+ toolName: context.toolName,
9077
+ toolCallId: context.toolCallId,
9078
+ conversationId: context.conversationId,
9079
+ turnId: context.turnId
9080
+ });
9081
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9082
+ }
9074
9083
  return {
9075
9084
  kind: "route",
9076
9085
  nextNodeId: remainingCalls.length > 0 ? "tool" : "llm",
@@ -9153,6 +9162,9 @@ var ToolNode = class {
9153
9162
  if (fuse.shouldFuse && remainingCalls.length === 0) {
9154
9163
  throw createToolProtocolFuseError(fuse.nextCount, context.exec.error);
9155
9164
  }
9165
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
9166
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9167
+ }
9156
9168
  return {
9157
9169
  kind: "route",
9158
9170
  // 同一个 assistant.tool_calls batch 必须为每个 call 产出 tool_output。
@@ -9677,7 +9689,8 @@ function createHostToolCallBootstrap(input) {
9677
9689
  conversationId,
9678
9690
  turnId,
9679
9691
  history: [...input.history ?? [], decisionEvent],
9680
- pendingToolCalls: [toolCall]
9692
+ pendingToolCalls: [toolCall],
9693
+ ...input.completionMode === void 0 ? {} : { toolBatchCompletionMode: input.completionMode }
9681
9694
  }
9682
9695
  };
9683
9696
  }