mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 14:10:24 +00:00
* refactor: move provider replay runtime ownership into plugins * fix(provider-runtime): address review followups --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
23 lines
662 B
TypeScript
23 lines
662 B
TypeScript
import type {
|
|
ProviderReplayPolicy,
|
|
ProviderReplayPolicyContext,
|
|
} from "openclaw/plugin-sdk/plugin-entry";
|
|
|
|
/**
|
|
* Returns the provider-owned replay policy for Anthropic transports.
|
|
*/
|
|
export function buildAnthropicReplayPolicy(ctx: ProviderReplayPolicyContext): ProviderReplayPolicy {
|
|
const modelId = ctx.modelId?.toLowerCase() ?? "";
|
|
|
|
return {
|
|
sanitizeMode: "full",
|
|
sanitizeToolCallIds: true,
|
|
toolCallIdMode: "strict",
|
|
preserveSignatures: true,
|
|
repairToolUseResultPairing: true,
|
|
validateAnthropicTurns: true,
|
|
allowSyntheticToolResults: true,
|
|
...(modelId.includes("claude") ? { dropThinkingBlocks: true } : {}),
|
|
};
|
|
}
|