refactor(plugins): move auth and model policy to providers

This commit is contained in:
Peter Steinberger
2026-03-15 20:58:59 -07:00
parent ca2f046668
commit a33caab280
30 changed files with 1080 additions and 653 deletions

View File

@@ -1,6 +1,15 @@
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
const PROVIDER_ID = "opencode";
const MINIMAX_PREFIX = "minimax-m2.5";
function isModernOpencodeModel(modelId: string): boolean {
const lower = modelId.trim().toLowerCase();
if (lower.endsWith("-free") || lower === "alpha-glm-4.7") {
return false;
}
return !lower.startsWith(MINIMAX_PREFIX);
}
const opencodePlugin = {
id: PROVIDER_ID,
@@ -19,6 +28,7 @@ const opencodePlugin = {
geminiThoughtSignatureSanitization: true,
geminiThoughtSignatureModelHints: ["gemini"],
},
isModernModelRef: ({ modelId }) => isModernOpencodeModel(modelId),
});
},
};