mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 16:10:24 +00:00
fix: recognize api.grok.x.ai as xAI-native endpoint
Fixes #61377 The provider attribution code only recognized api.x.ai as the xAI-native endpoint. Some users have api.grok.x.ai configured (or it appears in certain DNS/config scenarios) which would not resolve as xAI-native, causing web_search tool failures. This change adds api.grok.x.ai as an alias for xAI-native endpoint classification alongside api.x.ai.
This commit is contained in:
committed by
Peter Steinberger
parent
6067f2d9ad
commit
b35b176837
@@ -232,6 +232,10 @@ describe("provider attribution", () => {
|
||||
endpointClass: "xai-native",
|
||||
hostname: "api.x.ai",
|
||||
});
|
||||
expect(resolveProviderEndpoint("https://api.grok.x.ai/v1")).toMatchObject({
|
||||
endpointClass: "xai-native",
|
||||
hostname: "api.grok.x.ai",
|
||||
});
|
||||
expect(resolveProviderEndpoint("https://api.z.ai/api/coding/paas/v4")).toMatchObject({
|
||||
endpointClass: "zai-native",
|
||||
hostname: "api.z.ai",
|
||||
|
||||
@@ -238,7 +238,7 @@ export function resolveProviderEndpoint(
|
||||
if (host === "openrouter.ai" || host.endsWith(".openrouter.ai")) {
|
||||
return { endpointClass: "openrouter", hostname: host };
|
||||
}
|
||||
if (host === "api.x.ai") {
|
||||
if (host === "api.x.ai" || host === "api.grok.x.ai") {
|
||||
return { endpointClass: "xai-native", hostname: host };
|
||||
}
|
||||
if (host === "api.z.ai") {
|
||||
|
||||
Reference in New Issue
Block a user