fix: route Copilot Claude through Anthropic

This commit is contained in:
Peter Steinberger
2026-04-04 02:57:06 +09:00
parent e588a363f9
commit 5d20c73e05
10 changed files with 213 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ import {
} from "openclaw/plugin-sdk/provider-auth";
import { githubCopilotLoginCommand } from "openclaw/plugin-sdk/provider-auth-login";
import { PROVIDER_ID, resolveCopilotForwardCompatModel } from "./models.js";
import { wrapCopilotAnthropicStream } from "./stream.js";
import { DEFAULT_COPILOT_API_BASE_URL, resolveCopilotApiToken } from "./token.js";
import { fetchCopilotUsage } from "./usage.js";
@@ -152,6 +153,7 @@ export default definePluginEntry({
},
},
resolveDynamicModel: (ctx) => resolveCopilotForwardCompatModel(ctx),
wrapStreamFn: (ctx) => wrapCopilotAnthropicStream(ctx.streamFn),
buildReplayPolicy: ({ modelId }) => buildGithubCopilotReplayPolicy(modelId),
supportsXHighThinking: ({ modelId }) =>
COPILOT_XHIGH_MODEL_IDS.includes(modelId.trim().toLowerCase() as never),