Merge ddecd5226b0baf1f07c2d010cfd37a85574515e6 into 9fb78453e088cd7b553d7779faa0de5c83708e70

This commit is contained in:
Mhaizza 2026-03-20 22:20:39 -07:00 committed by GitHub
commit 52ef1f6962
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 8 deletions

View File

@ -34,8 +34,7 @@ describe("provider attribution", () => {
version: "2026.3.14",
headers: {
"HTTP-Referer": "https://openclaw.ai",
"X-OpenRouter-Title": "OpenClaw",
"X-OpenRouter-Categories": "cli-agent",
"X-Title": "OpenClaw",
},
});
});
@ -47,8 +46,7 @@ describe("provider attribution", () => {
}),
).toEqual({
"HTTP-Referer": "https://openclaw.ai",
"X-OpenRouter-Title": "OpenClaw",
"X-OpenRouter-Categories": "cli-agent",
"X-Title": "OpenClaw",
});
});

View File

@ -54,8 +54,7 @@ function buildOpenRouterAttributionPolicy(
...identity,
headers: {
"HTTP-Referer": "https://openclaw.ai",
"X-OpenRouter-Title": identity.product,
"X-OpenRouter-Categories": "cli-agent",
"X-Title": identity.product,
},
};
}

View File

@ -506,7 +506,7 @@ describe("applyCustomApiConfig", () => {
const provider = result.config.models?.providers?.[providerId];
expect(provider?.baseUrl).toBe("https://my-resource.services.ai.azure.com/openai/v1");
expect(provider?.api).toBe("openai-completions");
expect(provider?.api).toBe("openai-responses");
expect(provider?.authHeader).toBe(false);
expect(provider?.headers).toEqual({ "api-key": "key123" });

View File

@ -686,7 +686,7 @@ export function applyCustomApiConfig(params: ApplyCustomApiConfigParams): Custom
normalizeOptionalProviderApiKey(params.apiKey) ??
normalizeOptionalProviderApiKey(existingApiKey);
const providerApi = isAzureOpenAi
const providerApi = isAzure
? ("openai-responses" as const)
: resolveProviderApi(params.compatibility);
const azureHeaders = isAzure && normalizedApiKey ? { "api-key": normalizedApiKey } : undefined;