Repository navigation
Conversation
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
OpenRouter requires 'X-Title' header for app attribution, not 'X-OpenRouter-Title'. The incorrect header name caused OpenRouter to not recognize requests as coming from OpenClaw, resulting in free models (e.g., xiaomi/mimo-v2-pro) being charged at full price. Changes: - Replace 'X-OpenRouter-Title' with 'X-Title' per OpenRouter docs - Remove unnecessary 'X-OpenRouter-Categories' header - Update tests to match corrected headers Reference: https://openrouter.ai/docs/app-attribution Fixes openclaw#50738
Greptile SummaryThis PR fixes two separate issues: (1) corrects the OpenRouter app attribution header from the non-standard
Confidence Score: 4/5
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddecd5226b
ℹ️ 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".
| normalizeOptionalProviderApiKey(existingApiKey); | ||
|
|
||
| const providerApi = isAzureOpenAi | ||
| const providerApi = isAzure |
There was a problem hiding this comment.
Honor custom compatibility for Azure Foundry providers
Switching this condition from isAzureOpenAi to isAzure makes every *.services.ai.azure.com endpoint force api: "openai-responses", so applyCustomApiConfig now ignores params.compatibility for Azure Foundry URLs. In non-interactive onboarding (--custom-compatibility anthropic) this stores the wrong transport and routes traffic to OpenAI Responses semantics instead of the selected compatibility, which can break Foundry endpoints that require Anthropic-style /messages requests.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4139e064a5
ℹ️ 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".
| const providerApi = isAzure | ||
| ? ("openai-responses" as const) | ||
| : resolveProviderApi(params.compatibility); |
There was a problem hiding this comment.
Respect compatibility selection for Azure Foundry URLs
This change makes providerApi depend on isAzure instead of isAzureOpenAi, so all *.services.ai.azure.com custom providers are now saved as openai-responses and no longer honor params.compatibility. That breaks flows where users select or detect Anthropic compatibility (for example --custom-compatibility anthropic), because runtime requests will be shaped for OpenAI Responses instead of Anthropic /messages, which can fail against Foundry deployments expecting Anthropic semantics; the updated Foundry test expectation in this commit is fresh evidence that this regression is now encoded.
Useful? React with 👍 / 👎.
|
Closing this as implemented after Codex automated review. Close PR #50743. Current main already sends OpenRouter attribution headers through the provider stream path, the linked #50738 was closed as implemented with the broader missing-header/auth path covered, and OpenRouter’s current docs now document Best possible solution: Do not merge PR #50743. Keep the shipped OpenRouter attribution implementation that uses the current documented OpenRouter headers and forwards them through the provider-owned stream path. If any new billing issue appears, open a fresh issue with live OpenRouter request/dashboard evidence; the unrelated Azure Foundry transport change should remain out of this PR and continue to be handled by the current compatibility-preserving onboarding code. What I checked:
So I’m closing this as already implemented rather than keeping a duplicate issue open. Codex Review notes: model gpt-5.5, reasoning high; reviewed against 76cf013df507; fix evidence: release v2026.4.24, commit cbcfdf62c729. |
Summary
Fixes #50738 — OpenRouter free models being charged due to incorrect attribution headers.
Problem
OpenClaw was sending:
But OpenRouter requires (per docs):
This caused OpenRouter to not recognize requests as coming from OpenClaw:
app_id: null(should be2725608)origin: ""(should behttps://openclaw.ai/)xiaomi/mimo-v2-procharged at full price (~/bin/bash.22 for 11 requests)Changes
X-OpenRouter-Title→X-TitleX-OpenRouter-CategoriesTesting
Impact