

















@@ -72,19 +72,11 @@ function createNoopTools() {
7272];
7373}
747475-function replayValidationTools() {
76-return createNoopTools();
77-}
78-79-function disableResponsesReplayToolChoice(payload: unknown, model: Model<Api>): unknown {
80-if (!isOpenAIResponsesFamily(model.api) || !payload || typeof payload !== "object") {
81-return undefined;
82-}
83-const next = payload as { tool_choice?: unknown };
84-// Replay probes include historical tool calls to validate transcript repair,
85-// but they should not force a fresh noop tool call during the live request.
86-next.tool_choice = "none";
87-return next;
75+function replayValidationTools(model: Model<Api>) {
76+// Responses-family providers may force or reject fresh tool-choice policy
77+// when tools are present. These probes validate repaired historical transcript
78+// shape, not new tool invocation.
79+return isOpenAIResponsesFamily(model.api) ? undefined : createNoopTools();
8880}
89819082function buildReplayMessages(model: Model<Api>): AgentMessage[] {
@@ -278,13 +270,12 @@ describeLive("tool replay repair live", () => {
278270{
279271systemPrompt: "You are a concise assistant. Follow the user's instruction exactly.",
280272messages: sanitized as never,
281-tools: replayValidationTools(),
273+tools: replayValidationTools(model),
282274},
283275{
284276apiKey: requireApiKey(apiKeyInfo, model.provider),
285277reasoning: "low",
286278maxTokens: 96,
287-onPayload: disableResponsesReplayToolChoice,
288279},
289280120_000,
290281);
@@ -354,13 +345,12 @@ describeLive("tool replay repair live", () => {
354345{
355346systemPrompt: "You are a concise assistant. Follow the user's instruction exactly.",
356347messages: transformed as never,
357-tools: replayValidationTools(),
348+tools: replayValidationTools(model),
358349},
359350{
360351apiKey: requireApiKey(apiKeyInfo, model.provider),
361352reasoning: "low",
362353maxTokens: 96,
363-onPayload: disableResponsesReplayToolChoice,
364354},
365355120_000,
366356);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。