Skip to content

fix(onboard): restore openai-responses API for all Azure URLs#50740

Closed
Mhaizza wants to merge 1 commit intoopenclaw:mainfrom
Mhaizza:fix/50719-vllm-404-regression
Closed

fix(onboard): restore openai-responses API for all Azure URLs#50740
Mhaizza wants to merge 1 commit intoopenclaw:mainfrom
Mhaizza:fix/50719-vllm-404-regression

Conversation

@Mhaizza
Copy link
Copy Markdown

@Mhaizza Mhaizza commented Mar 20, 2026

Summary

Fixes #50719 — Local vLLM 404 regression introduced in 2026.3.13.

Root Cause

Commit 91104ac changed Azure URL detection in src/commands/onboard-custom.ts:

  • Before: isAzure → covered both *.services.ai.azure.com and *.openai.azure.com
  • After: isAzureOpenAi → only *.openai.azure.com

This broke local vLLM endpoints configured to use openai-responses API, causing them to route to /v1/chat/completions instead → 404 status code (no body).

Changes

  • Revert providerApi logic from isAzureOpenAi back to isAzure (line 689)
  • Update test expectation to match restored behavior

Testing

  • ✅ Downgrading to 2026.3.12 confirmed the fix
  • ✅ Test suite updated to expect openai-responses for Azure Foundry URLs

Impact

  • Restores backward compatibility for local vLLM + other OpenAI-compatible endpoints using openai-responses mode
  • Azure AI Foundry chat-completions models continue to work as before

Regression introduced in 91104ac 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 openclaw#50719
@openclaw-barnacle openclaw-barnacle bot added commands Command implementations size: XS labels Mar 20, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 20, 2026

Greptile Summary

This PR reverts a one-line regression introduced in commit 91104ac740 that narrowed the Azure URL guard from isAzure (covering both *.openai.azure.com and *.services.ai.azure.com) to isAzureOpenAi (only *.openai.azure.com), causing Azure AI Foundry endpoints to fall back to resolveProviderApi(compatibility) instead of always using "openai-responses". The fix and the corresponding test update are correct.

  • Core fix (onboard-custom.ts line 689): isAzureOpenAiisAzure restores "openai-responses" for all Azure-hosted URLs, including Azure AI Foundry (*.services.ai.azure.com).
  • Dead variable: const isAzureOpenAi on line 622 is now unused and should be removed.
  • Test description: The updated test case is titled "keeps selected compatibility for Azure AI Foundry URLs" but actually verifies the opposite — the compatibility param is overridden; the name should be updated to reflect this.

Confidence Score: 4/5

  • Safe to merge — correct targeted revert of a regression with a matching test update; only minor cleanup items remain.
  • The change is a minimal, well-understood revert of a single variable reference. The regression root cause is clearly identified and the fix directly addresses it. The only gaps are a leftover unused isAzureOpenAi variable and a misleading test name, neither of which affects runtime behaviour.
  • No files require special attention beyond cleaning up the unused isAzureOpenAi variable in src/commands/onboard-custom.ts.

Comments Outside Diff (2)

  1. src/commands/onboard-custom.ts, line 622 (link)

    P2 Unused variable after revert

    isAzureOpenAi is now declared but never referenced anywhere in the function after the change on line 689 switched back to isAzure. This is dead code and should be removed to avoid potential lint warnings and confusion for future readers.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/commands/onboard-custom.ts
    Line: 622
    
    Comment:
    **Unused variable after revert**
    
    `isAzureOpenAi` is now declared but never referenced anywhere in the function after the change on line 689 switched back to `isAzure`. This is dead code and should be removed to avoid potential lint warnings and confusion for future readers.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
  2. src/commands/onboard-custom.test.ts, line 497 (link)

    P2 Misleading test description

    The test name says "keeps selected compatibility for Azure AI Foundry URLs", but the test passes compatibility: "openai" and then asserts api is "openai-responses" — i.e., the compatibility is not kept; it is overridden. A more accurate description would be something like "overrides compatibility with openai-responses for Azure AI Foundry URLs".

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/commands/onboard-custom.test.ts
    Line: 497
    
    Comment:
    **Misleading test description**
    
    The test name says "keeps selected compatibility for Azure AI Foundry URLs", but the test passes `compatibility: "openai"` and then asserts `api` is `"openai-responses"` — i.e., the compatibility is **not** kept; it is overridden. A more accurate description would be something like `"overrides compatibility with openai-responses for Azure AI Foundry URLs"`.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/commands/onboard-custom.ts
Line: 622

Comment:
**Unused variable after revert**

`isAzureOpenAi` is now declared but never referenced anywhere in the function after the change on line 689 switched back to `isAzure`. This is dead code and should be removed to avoid potential lint warnings and confusion for future readers.

```suggestion
  const isAzure = isAzureUrl(baseUrl);
  const resolvedBaseUrl = isAzure ? transformAzureConfigUrl(baseUrl) : baseUrl;
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/commands/onboard-custom.test.ts
Line: 497

Comment:
**Misleading test description**

The test name says "keeps selected compatibility for Azure AI Foundry URLs", but the test passes `compatibility: "openai"` and then asserts `api` is `"openai-responses"` — i.e., the compatibility is **not** kept; it is overridden. A more accurate description would be something like `"overrides compatibility with openai-responses for Azure AI Foundry URLs"`.

```suggestion
  it("overrides compatibility with openai-responses for Azure AI Foundry URLs", () => {
```

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: "fix(onboard): restor..."

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba811b4629

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +689 to 690
const providerApi = isAzure
? ("openai-responses" as const)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve selected compatibility for Azure Foundry URLs

This change makes every Azure URL (isAzure) use openai-responses, which overrides the user-selected compatibility for *.services.ai.azure.com endpoints. The onboarding flow still allows and verifies Anthropic-style Azure Foundry endpoints (requestAnthropicVerification), but this assignment now writes an OpenAI Responses provider anyway, so a successful verification can produce a saved config that later calls the wrong API surface at runtime.

Useful? React with 👍 / 👎.

@obviyus
Copy link
Copy Markdown
Contributor

obviyus commented Mar 29, 2026

Closing as duplicate; this was superseded by #50535.

@obviyus obviyus closed this Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 404 status code (body not found)

2 participants