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

@@ -1,4 +1,5 @@
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
import { resolveCopilotTransportApi } from "./models.js";
const DEFAULT_CONTEXT_WINDOW = 128_000;
const DEFAULT_MAX_TOKENS = 8192;
@@ -30,10 +31,7 @@ export function buildCopilotModelDefinition(modelId: string): ModelDefinitionCon
return {
id,
name: id,
// pi-coding-agent's registry schema doesn't know about a "github-copilot" API.
// We use OpenAI-compatible responses API, while keeping the provider id as
// "github-copilot" (pi-ai uses that to attach Copilot-specific headers).
api: "openai-responses",
api: resolveCopilotTransportApi(id),
reasoning: false,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },