Skip to content

fix(provider): tui/agent etc not working when azure openai endpoint is onboarded through custom provider#49543

Merged
obviyus merged 2 commits intoopenclaw:mainfrom
kunalk16:fix-azure-openai-issue-custom-PR
Mar 19, 2026
Merged

fix(provider): tui/agent etc not working when azure openai endpoint is onboarded through custom provider#49543
obviyus merged 2 commits intoopenclaw:mainfrom
kunalk16:fix-azure-openai-issue-custom-PR

Conversation

@kunalk16
Copy link
Copy Markdown
Contributor

@kunalk16 kunalk16 commented Mar 18, 2026

Summary

Describe the problem and fix in 2–5 bullets:

  1. Onboard an Azure OpenAI endpoint through the custom provider with the correct details
  2. Use tui or agent, it fails

When Azure OpenAI endpoint is configured using the custom provider option, it is updated in the config with api "openai-completions". This refers to the "openai-completions" of pi-ai and when LLM calls are made to the endpoint, it fails with 404 response. My changes are going to update the onboarding code such that it instead uses the "openai-responses" api which works with azure openai endpoints. We could have also used the "azure-openai-responses" option of pi-ai but that asks for more changes so going for "openai-responses"

  • Problem:
  • Why it matters: Azure subscribers with Azure OpenAI endpoints are unable to use openclaw and they dont understand what is the issue after successfully onboarding the endpoint through the onboarding using custom provider option.
  • What changed: Only the config generated by the custom provider onboarding wizard changed, it now generates openai-responses based config for azure openai endpoints rather than openai-completions.
  • What did NOT change (scope boundary): Only the config update logic changed for azure openai endpoints, not openai endpoints/

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

List user-visible changes (including defaults/config).
None

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No
  • If any Yes, explain risk + mitigation:

Repro + Verification

It was reproed in my ubuntu machine/container, it was not working before the fix
image

Environment

  • OS: Ubuntu 24.04
  • Runtime/container: Azure VM/container both
  • Model/provider: Azure OpenAI gpt-5.2-chat
  • Integration/channel (if any):
  • Relevant config (redacted):
    Old config generated
{
  "wizard": {
    "lastRunAt": "2026-03-15T06:13:42.390Z",
    "lastRunVersion": "2026.3.14",
    "lastRunCommand": "onboard",
    "lastRunMode": "local"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "custom-someresourcexyz-openai-azure-com": {
        "baseUrl": "https://someresourcexyz.openai.azure.com/openai/deployments/gpt-5.2-chat",
        "apiKey": "someapikey",
        "api": "openai-completions",
        "models": [
          {
            "id": "gpt-5.2-chat",
            "name": "gpt-5.2-chat (Custom Provider)",
            "reasoning": false,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 16000,
            "maxTokens": 4096
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "custom-someresourcexyz-openai-azure-com/gpt-5.2-chat"
      },
      "models": {
        "custom-someresourcexyz-openai-azure-com/gpt-5.2-chat": {}
      },
      "workspace": "/root/.openclaw/workspace"
    }
  },
  "tools": {
    "profile": "coding"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw"
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "sometoken"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    },
    "nodes": {
      "denyCommands": [
        "camera.snap",
        "camera.clip",
        "screen.record",
        "contacts.add",
        "calendar.add",
        "reminders.add",
        "sms.send"
      ]
    }
  },
  "meta": {
    "lastTouchedVersion": "2026.3.14",
    "lastTouchedAt": "2026-03-15T06:13:42.400Z"
  }
}

Steps

  1. Onboard openclaw with azure openai endpoint
  2. Try out tui or agent

Expected

  • Tui or agent invocation would work

Actual

  • Tui and agent invocation fails before the fix
image

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

Verified the onboarding then testes tui, agent commands execution
Custom provider onboarded:
image

TUI/Agent both works now after the fix:
image

Config generated by the onboarding wizard:

{
  "meta": {
    "lastTouchedVersion": "2026.3.13",
    "lastTouchedAt": "2026-03-18T06:22:20.794Z"
  },
  "wizard": {
    "lastRunAt": "2026-03-18T06:22:20.786Z",
    "lastRunVersion": "2026.3.13",
    "lastRunCommand": "onboard",
    "lastRunMode": "local"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "custom-myresource-openai-azure-com": {
        "baseUrl": "https://myresource.openai.azure.com/openai/v1",
        "apiKey": "hidden-api-key",
        "api": "openai-responses",
        "headers": {
          "api-key": "hidden-api-key"
        },
        "authHeader": false,
        "models": [
          {
            "id": "gpt-5.2-chat",
            "name": "gpt-5.2-chat (Custom Provider)",
            "reasoning": true,
            "input": [
              "text",
              "image"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 400000,
            "maxTokens": 16384,
            "compat": {
              "supportsStore": false
            }
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "custom-myresource-openai-azure-com/gpt-5.2-chat"
      },
      "models": {
        "custom-myresource-openai-azure-com/gpt-5.2-chat": {
          "params": {
            "thinking": "medium"
          }
        }
      },
      "workspace": "/root/.openclaw/workspace"
    }
  },
  "tools": {
    "profile": "coding"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw"
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "7c4feae22c3dcf0a629c9f3c29aa683a5f086739111f74cf"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    },
    "nodes": {
      "denyCommands": [
        "camera.snap",
        "camera.clip",
        "screen.record",
        "contacts.add",
        "calendar.add",
        "reminders.add",
        "sms.send"
      ]
    }
  }
}

What you personally verified (not just CI), and how:

  • Verified scenarios: Manually onboarded, checked the config, tui chat execution, agent execution
  • Edge cases checked:
  • What you did not verify:

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? Not applicable
  • Config/env changes? Not applicable
  • Migration needed? Not applicable
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Revert the PR, use non-azure openai endpoint through custom provider, this flow never worked before so it will not be an issue
  • Files/config to restore:
  • Known bad symptoms reviewers should watch for:

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.
None

  • Risk:
    • Mitigation:

@openclaw-barnacle openclaw-barnacle bot added commands Command implementations size: S labels Mar 18, 2026
@kunalk16 kunalk16 marked this pull request as ready for review March 18, 2026 07:17
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR fixes a real bug where Azure OpenAI endpoints onboarded via the custom provider wizard were stored with api: "openai-completions" (a legacy pi-ai API that returns 404 against Azure) and a deployment-specific baseUrl, causing TUI and agent invocations to fail immediately after onboarding.

What changed:

  • applyCustomApiConfig now detects Azure URLs (both *.openai.azure.com and *.services.ai.azure.com) and stores the provider with api: "openai-responses", a normalised /openai/v1 base URL, authHeader: false, and an api-key request header.
  • New transformAzureConfigUrl helper normalises the stored URL, including stripping pre-existing deployment paths to avoid malformed config on re-onboard.
  • New hasSameHost helper lets resolveUniqueEndpointId match an existing Azure provider whose stored URL has a different path suffix, preventing duplicate provider entries on re-onboard.
  • Azure models that look like reasoning models (matching /\b(o[134]|gpt-([5-9]|\d{2,}))\b/i) get reasoning: true, multimodal input, compat.supportsStore: false, and a thinking: "medium" default — all of which can be overridden by existing user config.
  • Higher AZURE_DEFAULT_CONTEXT_WINDOW (400 000) and AZURE_DEFAULT_MAX_TOKENS (16 384) are used for fresh Azure onboards.
  • Non-Azure paths are untouched.
  • Comprehensive new tests cover all the above paths, including edge cases like URL normalisation and reasoning-param preservation.

Minor note:
On re-onboard of an existing Azure model, the new AZURE_DEFAULT_CONTEXT_WINDOW is applied by the nextModel spread but is immediately overridden by normalizeContextWindowForCustomModel(model.contextWindow), so existing users with the old (smaller) context window won't automatically receive the upgrade. Whether this is intentional (preserve user customisations) or an oversight is worth confirming.

Confidence Score: 4/5

  • Safe to merge; the fix is narrowly scoped to Azure custom-provider onboarding and does not regress non-Azure paths.
  • The core bug fix (switching from openai-completions to openai-responses and normalising the base URL) is correct and well-tested. All previously raised review issues appear to be addressed. The one remaining concern — that re-onboarding an existing Azure model silently skips the new AZURE_DEFAULT_CONTEXT_WINDOW upgrade — is non-critical and doesn't affect runtime correctness. No security, auth, or data-integrity risks introduced.
  • No files require special attention beyond the inline comment on the context-window ordering in src/commands/onboard-custom.ts.

Comments Outside Diff (1)

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

    Re-onboard loses Azure default context window

    When re-onboarding an existing Azure model, nextModel.contextWindow (AZURE_DEFAULT_CONTEXT_WINDOW = 400_000) is spread in first via ...(isAzure ? nextModel : {}), but is immediately overwritten on the very next line by normalizeContextWindowForCustomModel(model.contextWindow), which reads the old model's value. A user who originally onboarded under the broken openai-completions path (e.g. with the old default contextWindow: 16000) will re-onboard, fix the API path, but keep contextWindow: 16000 instead of getting the new Azure default of 400,000.

    If the intent is to upgrade the context window on re-onboard you'd need to only fall back to the normalized existing value when it actually exceeds AZURE_DEFAULT_CONTEXT_WINDOW, for example:

    contextWindow: Math.max(
      normalizeContextWindowForCustomModel(model.contextWindow),
      AZURE_DEFAULT_CONTEXT_WINDOW,
    ),

    If the intent is strictly "preserve user customisations", the current behaviour is defensible, but it is worth noting that the upgrade in defaults will never reach existing Azure users on re-onboard.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/commands/onboard-custom.ts
Line: 657-670

Comment:
**Re-onboard loses Azure default context window**

When re-onboarding an existing Azure model, `nextModel.contextWindow` (`AZURE_DEFAULT_CONTEXT_WINDOW = 400_000`) is spread in first via `...(isAzure ? nextModel : {})`, but is immediately overwritten on the very next line by `normalizeContextWindowForCustomModel(model.contextWindow)`, which reads the *old* model's value. A user who originally onboarded under the broken `openai-completions` path (e.g. with the old default `contextWindow: 16000`) will re-onboard, fix the API path, but keep `contextWindow: 16000` instead of getting the new Azure default of `400,000`.

If the intent is to upgrade the context window on re-onboard you'd need to only fall back to the normalized existing value when it actually exceeds `AZURE_DEFAULT_CONTEXT_WINDOW`, for example:

```ts
contextWindow: Math.max(
  normalizeContextWindowForCustomModel(model.contextWindow),
  AZURE_DEFAULT_CONTEXT_WINDOW,
),
```

If the intent is strictly "preserve user customisations", the current behaviour is defensible, but it is worth noting that the upgrade in defaults will never reach existing Azure users on re-onboard.

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

Last reviewed commit: "Use higher defaults ..."

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: a2f01642de

ℹ️ 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".

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: bcda72f8bb

ℹ️ 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".

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: 4a67fe404a

ℹ️ 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".

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: 79aef76ed5

ℹ️ 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".

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: 8ae9405815

ℹ️ 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".

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: cd22113115

ℹ️ 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".

@andyzhang88888
Copy link
Copy Markdown

Review

Good fix for Azure OpenAI custom provider onboarding. The changes to onboard-custom.ts are well-scoped with proper test coverage.

LGTM.

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: 2b0e198e32

ℹ️ 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".

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: 6e834b9cb5

ℹ️ 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".

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: 9db50e52ac

ℹ️ 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".

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: 20198a006e

ℹ️ 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".

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: 95fd43d513

ℹ️ 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".

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai

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: 4dc81c2f35

ℹ️ 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".

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai please review again and update the greptile score.

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: 3c3035ef4c

ℹ️ 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".

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai please review again and update the greptile score.

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: f86044973b

ℹ️ 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".

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai please review again and update the score.

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: 2e925a2bdc

ℹ️ 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".

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai all fixed.

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: 3f25155bfd

ℹ️ 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".

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai

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

return await requestVerification({
endpoint,
headers,
body: {
messages: [{ role: "user", content: "Hi" }],

P2 Badge Verify Azure custom endpoints against the Responses surface

This Azure-specific verification path still probes chat/completions, while applyCustomApiConfig() now always saves Azure custom providers as api: "openai-responses". That means any Azure deployment that is valid on the Responses API but not on Chat Completions will be rejected during onboarding even though the generated runtime config would work, so the new Azure flow is still blocked for part of the model catalog.

ℹ️ 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".

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: a916fa0b58

ℹ️ 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".

Takhoffman added a commit to kunalk16/openclaw that referenced this pull request Mar 19, 2026
@Takhoffman Takhoffman force-pushed the fix-azure-openai-issue-custom-PR branch from a916fa0 to c4fc964 Compare March 19, 2026 05:49
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: c4fc964e95

ℹ️ 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".

@kunalk16
Copy link
Copy Markdown
Contributor Author

@Takhoffman thanks for the updates.

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: f2cc005a22

ℹ️ 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".

@kunalk16
Copy link
Copy Markdown
Contributor Author

@greptileai

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: e8fb0d7d09

ℹ️ 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".

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: 540a736c4d

ℹ️ 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".

@obviyus obviyus self-assigned this Mar 19, 2026
@obviyus obviyus force-pushed the fix-azure-openai-issue-custom-PR branch from 540a736 to b7eb68c Compare March 19, 2026 15:59
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: b7eb68caf0

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +681 to +683
const providerApi = isAzure
? ("openai-responses" as const)
: resolveProviderApi(params.compatibility);
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 Don't force Responses on every services.ai endpoint

Fresh docs evidence: Microsoft's Azure v1 lifecycle docs say https://<resource>.services.ai.azure.com/openai/v1 can also serve chat-completions models from other providers like DeepSeek and Grok. This branch now treats every *.services.ai.azure.com URL as Azure Responses and ignores params.compatibility, so onboarding one of those valid Foundry endpoints will be persisted with api: "openai-responses" and the first real request will go to /responses instead of the chat-completions route that host actually supports.

Useful? React with 👍 / 👎.

@obviyus
Copy link
Copy Markdown
Contributor

obviyus commented Mar 19, 2026

Manually tested against Azure OpenAI after the latest fixes.

Used https://<resource-name>.openai.azure.com with gpt-5.3-chat. Onboarding now verifies successfully, writes the expected openai-responses Azure config, and a real openclaw agent --local run completed successfully with that model.

@obviyus obviyus force-pushed the fix-azure-openai-issue-custom-PR branch from 2bf5d0d to 41d006e Compare March 19, 2026 16:22
@obviyus obviyus merged commit 5b1836d into openclaw:main Mar 19, 2026
11 checks passed
@obviyus
Copy link
Copy Markdown
Contributor

obviyus commented Mar 19, 2026

Landed on main.

Thanks @kunalk16.

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: 41d006eb00

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +76 to +80
if (normalizedUrl.endsWith("/openai/v1")) {
return normalizedUrl;
}
// Strip a full deployment path back to the base origin
const deploymentIdx = normalizedUrl.indexOf("/openai/deployments/");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Strip pasted Azure /openai/v1/* paths before appending /openai/v1

Fresh evidence in this revision: requestOpenAiVerification() now also routes interactive Azure probes through transformAzureConfigUrl(), so this is no longer limited to non-interactive onboarding. This helper only accepts an exact /openai/v1 suffix; if a user pastes a full Azure endpoint like https://.../openai/v1/chat/completions or .../openai/v1/responses, it falls through here and produces a broken base URL such as .../openai/v1/chat/completions/openai/v1, which makes the wizard fail verification and makes non-interactive onboarding persist an unusable config.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: tui/agent etc not working when azure openai endpoint is onboarded

3 participants