From ba811b4629c0bc06ca2df4132eda84ea8422f0ef Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Fri, 20 Mar 2026 08:31:31 +0700 Subject: [PATCH] fix(onboard): restore openai-responses API for all Azure URLs Regression introduced in 91104ac740 broke local vLLM endpoints that rely on openai-responses API compatibility. The commit narrowed Azure detection from 'isAzure' to 'isAzureOpenAi' (*.openai.azure.com only), causing non-Azure OpenAI-compatible endpoints to route to /v1/chat/completions instead of /responses. This resulted in 404 errors for local vLLM setups configured with openai-responses mode. Fix: Revert providerApi logic to use 'isAzure' (covers both *.services.ai.azure.com and *.openai.azure.com) to preserve backward compatibility. Fixes #50719 --- src/commands/onboard-custom.test.ts | 2 +- src/commands/onboard-custom.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/onboard-custom.test.ts b/src/commands/onboard-custom.test.ts index 7917d45ca8f..b4dc7cbd7db 100644 --- a/src/commands/onboard-custom.test.ts +++ b/src/commands/onboard-custom.test.ts @@ -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" }); diff --git a/src/commands/onboard-custom.ts b/src/commands/onboard-custom.ts index 5afab742448..9f0b7e3d162 100644 --- a/src/commands/onboard-custom.ts +++ b/src/commands/onboard-custom.ts @@ -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;