mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-13 18:21:27 +00:00
* refactor: move provider replay runtime ownership into plugins * fix(provider-runtime): address review followups --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
25 lines
662 B
TypeScript
25 lines
662 B
TypeScript
import type {
|
|
ProviderReplayPolicy,
|
|
ProviderReplayPolicyContext,
|
|
} from "openclaw/plugin-sdk/plugin-entry";
|
|
|
|
/**
|
|
* Returns the provider-owned replay policy for OpenAI-family transports.
|
|
*/
|
|
export function buildOpenAIReplayPolicy(ctx: ProviderReplayPolicyContext): ProviderReplayPolicy {
|
|
return {
|
|
sanitizeMode: "images-only",
|
|
applyAssistantFirstOrderingFix: false,
|
|
validateGeminiTurns: false,
|
|
validateAnthropicTurns: false,
|
|
...(ctx.modelApi === "openai-completions"
|
|
? {
|
|
sanitizeToolCallIds: true,
|
|
toolCallIdMode: "strict" as const,
|
|
}
|
|
: {
|
|
sanitizeToolCallIds: false,
|
|
}),
|
|
};
|
|
}
|