mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 02:20:22 +00:00
refactor: move provider replay runtime ownership into plugins (#60126)
* refactor: move provider replay runtime ownership into plugins * fix(provider-runtime): address review followups --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -4,6 +4,23 @@ import { applyOpencodeGoConfig, OPENCODE_GO_DEFAULT_MODEL_REF } from "./api.js";
|
||||
|
||||
const PROVIDER_ID = "opencode-go";
|
||||
|
||||
function buildOpencodeGoReplayPolicy(modelId?: string) {
|
||||
const normalizedModelId = modelId?.toLowerCase() ?? "";
|
||||
return {
|
||||
applyAssistantFirstOrderingFix: false,
|
||||
validateGeminiTurns: false,
|
||||
validateAnthropicTurns: false,
|
||||
...(normalizedModelId.includes("gemini")
|
||||
? {
|
||||
sanitizeThoughtSignatures: {
|
||||
allowBase64Only: true,
|
||||
includeCamelCase: true,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
export default definePluginEntry({
|
||||
id: PROVIDER_ID,
|
||||
name: "OpenCode Go Provider",
|
||||
@@ -43,11 +60,7 @@ export default definePluginEntry({
|
||||
},
|
||||
}),
|
||||
],
|
||||
capabilities: {
|
||||
openAiCompatTurnValidation: false,
|
||||
geminiThoughtSignatureSanitization: true,
|
||||
geminiThoughtSignatureModelHints: ["gemini"],
|
||||
},
|
||||
buildReplayPolicy: ({ modelId }) => buildOpencodeGoReplayPolicy(modelId),
|
||||
isModernModelRef: () => true,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user