
























@@ -1058,7 +1058,23 @@ describe("sanitizeSessionHistory", () => {
10581058});
1059105910601060it("preserves signed thinking turns while repairing legacy tool-result pairing for anthropic", async () => {
1061+setNonGoogleModelApi();
10611062const sessionManager = makeMockSessionManager();
1063+const nativeAnthropicPolicy: TranscriptPolicy = {
1064+sanitizeMode: "full",
1065+sanitizeToolCallIds: true,
1066+toolCallIdMode: "strict",
1067+preserveNativeAnthropicToolUseIds: true,
1068+repairToolUseResultPairing: true,
1069+preserveSignatures: true,
1070+sanitizeThinkingSignatures: false,
1071+dropThinkingBlocks: false,
1072+dropReasoningFromHistory: false,
1073+applyGoogleTurnOrdering: false,
1074+validateGeminiTurns: false,
1075+validateAnthropicTurns: true,
1076+allowSyntheticToolResults: true,
1077+};
10621078const messages: AgentMessage[] = [
10631079makeUserMessage("Use the gateway"),
10641080makeAssistantMessage(
@@ -1085,13 +1101,15 @@ describe("sanitizeSessionHistory", () => {
10851101modelId: "claude-sonnet-4-6",
10861102 sessionManager,
10871103sessionId: TEST_SESSION_ID,
1104+policy: nativeAnthropicPolicy,
10881105});
10891106const validated = await validateReplayTurns({
10901107messages: sanitized,
10911108modelApi: "anthropic-messages",
10921109provider: "anthropic",
10931110modelId: "claude-opus-4-6",
10941111sessionId: TEST_SESSION_ID,
1112+policy: nativeAnthropicPolicy,
10951113});
1096111410971115expect(sanitized.map((msg) => msg.role)).toEqual(["user", "assistant", "toolResult", "user"]);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。