@@ -35,6 +35,7 @@ import { STREAM_ERROR_FALLBACK_TEXT } from "../stream-message-shared.js";
3535import { sanitizeToolCallIdsForCloudCodeAssist } from "../tool-call-id.js" ;
3636import type { TranscriptPolicy } from "../transcript-policy.js" ;
3737import {
38+ providerRequiresSignedThinking ,
3839 resolveTranscriptPolicy ,
3940 shouldAllowProviderOwnedThinkingReplay ,
4041} from "../transcript-policy.js" ;
@@ -658,12 +659,6 @@ function isSameModelSnapshot(a: ModelSnapshotEntry, b: ModelSnapshotEntry): bool
658659 ) ;
659660}
660661
661- const SIGNED_THINKING_PROVIDERS = new Set ( [ "anthropic" , "amazon-bedrock" , "anthropic-vertex" ] ) ;
662-
663- function providerRequiresSignedThinking ( provider ?: string | null ) : boolean {
664- return SIGNED_THINKING_PROVIDERS . has ( provider ?? "" ) ;
665- }
666-
667662/**
668663 * Applies the generic replay-history cleanup pipeline before provider-owned
669664 * replay hooks run.
@@ -697,12 +692,11 @@ export async function sanitizeSessionHistory(params: {
697692 } ) ;
698693 const withInterSessionMarkers = annotateInterSessionUserMessages ( params . messages ) ;
699694 const signedThinkingProvider = providerRequiresSignedThinking ( params . provider ) ;
700- const allowProviderOwnedThinkingReplay =
701- shouldAllowProviderOwnedThinkingReplay ( {
702- modelApi : params . modelApi ,
703- policy,
704- } ) ||
705- ( signedThinkingProvider && ! policy . dropThinkingBlocks ) ;
695+ const allowProviderOwnedThinkingReplay = shouldAllowProviderOwnedThinkingReplay ( {
696+ modelApi : params . modelApi ,
697+ provider : params . provider ,
698+ policy,
699+ } ) ;
706700 const isOpenAIResponsesApi =
707701 params . modelApi === "openai-responses" ||
708702 params . modelApi === "openai-codex-responses" ||
0 commit comments