chore(provider): use pi-ai's azure-openai-responses for azure openai endpoints#50851
Conversation
f798500 to
436dd99
Compare
Greptile SummaryThis PR extends the Azure OpenAI custom provider onboarding flow to use pi-ai's dedicated
The change is narrow and focused. The Confidence Score: 5/5Safe to merge — change is small, focused, and all four touch-points (type enum, JSON schema, transport normalizer, onboarding logic) are updated consistently with matching test coverage. No new P0/P1 issues found. All remaining observations from prior review threads (trailing comma, CHANGELOG scope wording) are already logged and tracked there. The core logic change is a single string swap that is fully consistent with the existing codebase patterns and validated by updated tests. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/config/types.models.ts | Adds 'azure-openai-responses' to MODEL_APIS const array — straightforward enum extension. |
| src/config/schema.base.generated.ts | Adds 'azure-openai-responses' to both api enum arrays in the generated JSON schema — consistent with types.models.ts change. |
| src/agents/pi-embedded-runner/model.ts | Adds 'azure-openai-responses' case to normalizeResolvedTransportApi switch — passes it through as a valid transport API. |
| src/commands/onboard-custom.ts | Switches providerApi for isAzureOpenAi from 'openai-responses' to 'azure-openai-responses' — core logic change. |
| src/commands/onboard-custom.test.ts | Updates two test expectations to assert 'azure-openai-responses' for Azure OpenAI URLs — correctly mirrors the source change. |
| CHANGELOG.md | Adds two changelog entries for #49543 and #50851; prior thread already flagged the Azure AI Foundry scope wording. |
Reviews (7): Last reviewed commit: "Fix generated file" | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 436dd99c39
ℹ️ 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".
218221b to
366efe9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 366efe9c1e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49ae5aaf3f
ℹ️ 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".
1 similar comment
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33b86851e9
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eca004a911
ℹ️ 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
left a comment
There was a problem hiding this comment.
Hmm, this seems incomplete. A lot of OpenClaw still only checks for api === "openai-responses" before doing the cleanup/sanitization logic. So after this PR, newly onboarded Azure models still go through Azure transport, but they stop getting the existing cleanup behavior
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7c6134694
ℹ️ 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".
620b310 to
57cb38f
Compare
obviyus
left a comment
There was a problem hiding this comment.
Reviewed latest changes; landing now.
…50851) (thanks @kunalk16) * Add azure-openai-responses * Unit tests update for updated API * Add entry for PR openclaw#50851 * Add comma to address PR comment Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Address PR comment on sanitization of output * Address review comment * Revert commits * Revert commit * Update changelog stating Azure OpenAI only Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Add references * Address PR comment on sanitization of output * Address review comment * Revert commits * Revert commit * Address PR comment on sanitization of output * Address review comment * Revert commits * Revert commit * Fix generated file * Add azure openai responses to OPENAI_RESPONSES_APIS * Add azure openai responses to createParallelToolCallsWrapper * Adding azure openai responses to attempt.ts * Add azure openai responses to google.ts * Address PR comment on sanitization of output * Revert commit * Address PR comment on sanitization of output * Revert commit * Address PR comment on sanitization of output * Revert commit * Fix changelog * Fix linting * fix: cover azure responses wrapper path (openclaw#50851) (thanks @kunalk16) --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <[email protected]>
…50851) (thanks @kunalk16) * Add azure-openai-responses * Unit tests update for updated API * Add entry for PR openclaw#50851 * Add comma to address PR comment Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Address PR comment on sanitization of output * Address review comment * Revert commits * Revert commit * Update changelog stating Azure OpenAI only Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Add references * Address PR comment on sanitization of output * Address review comment * Revert commits * Revert commit * Address PR comment on sanitization of output * Address review comment * Revert commits * Revert commit * Fix generated file * Add azure openai responses to OPENAI_RESPONSES_APIS * Add azure openai responses to createParallelToolCallsWrapper * Adding azure openai responses to attempt.ts * Add azure openai responses to google.ts * Address PR comment on sanitization of output * Revert commit * Address PR comment on sanitization of output * Revert commit * Address PR comment on sanitization of output * Revert commit * Fix changelog * Fix linting * fix: cover azure responses wrapper path (openclaw#50851) (thanks @kunalk16) --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <[email protected]>
Summary
Describe the problem and fix in 2–5 bullets:
This is just a small extension to this PR: #49543
We now use the "azure-openai-responses" implementation for azure openai custom provider endpoint. A manually configured azure openai endpoint with api "azure-openai-responses" fails as the enum MODEL_APIS in types.models.ts does not have an entry for "azure-openai-responses"
Response sanitization, etc not needed for azure-openai-responses as we have done for openai-responses, verified it manually
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
List user-visible changes (including defaults/config).
The generated config now has api "azure-openai-responses" rather than "openai-responses" for custom provider azure openai endpoints.
Security Impact (required)
NoNoNoNoNoYes, explain risk + mitigation:Repro + Verification
Manually verified that after the change, tui and agent with tool calls work with a configured azure openai endpoint

Manually verified that after the change, the api field in focus generates "azure-openai-responses"

Environment
{ "wizard": { "lastRunAt": "2026-03-20T04:33:02.576Z", "lastRunVersion": "2026.3.14", "lastRunCommand": "onboard", "lastRunMode": "local" }, "models": { "mode": "merge", "providers": { "custom-kkarmakar-ai-eus2-openai-azure-com": { "baseUrl": "https://resource.openai.azure.com/openai/v1", "apiKey": "key1234", "api": "azure-openai-responses", "headers": { "api-key": "key1234" }, "authHeader": false, "models": [ { "id": "gpt-5.3-chat", "name": "gpt-5.3-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-resource-openai-azure-com/gpt-5.3-chat" }, "models": { "custom-resource-openai-azure-com/gpt-5.3-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": "0e8dbc50a15d49e09a70c4594b0f1a0abcbce8f6e1ebc51d" }, "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-20T04:33:02.586Z" } }Steps
Expected
TUI/Agent should work
Actual
Currently, without the change, onboarding wizard generates a config with "openai-responses" api fo azure openai responses which works but we dont know if any use case will break as pi-ai has a dedicated "azure-openai-responses" specifically for azure openai endpoints.
A manually configured azure openai endpoint with api "azure-openai-responses" fails as the enum MODEL_APIS in types.models.ts does not have an entry for "azure-openai-responses"
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Manually installed openclaw, did the onboarding with custom provider interactive onboarding, verified tui & agent tool calls, verified the config file generated
Response sanitization, etc not needed for azure-openai-responses as we have done for openai-responses, verified it manually, if we add the sanitization, we get 400 errors for azure-openai-responses
Review Conversations
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
Not applicableNot applicableNot applicableFailure Recovery (if this breaks)
Risks and Mitigations
NoneList only real risks for this PR. Add/remove entries as needed. If none, write
None.