Open
Conversation
…resolution The previous implementation incorrectly used provider.anthropicApiHost to determine API protocol, causing all models on mixed providers (aihubmix, dmxapi, etc.) to be misidentified as anthropic-messages. Replace the if-else chain with declarative mapping tables (endpoint_type, provider type, provider id) and model name inference fallback. Also fix aihubmix OAuth URL (path change + leading space), add support for all 8 OpenClaw protocols, and add 22 unit tests covering all priority levels and the original bug. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
Model name inference (Step 4) was too aggressive — it matched model names like "gemini" or "claude" on ALL providers, causing openrouter (which proxies everything via OpenAI-compatible API) to get wrong protocols. Now Step 4 only infers anthropic-messages when the provider has a dedicated Anthropic endpoint (anthropicApiHost is set). Providers without it (e.g. openrouter) always fall through to the default openai-completions. Also removes unused isGeminiModel — no provider has a separate Gemini endpoint, so gemini models on aggregators should use openai-completions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
The native Google Gemini provider (type: 'gemini') was missing from PROVIDER_TYPE_TO_OPENCLAW_API, causing it to fall through to the default openai-completions instead of google-generative-ai. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
Add geminiApiHost field to Provider type and configure it for aihubmix. Step 4 now checks each vendor-specific host independently: - anthropicApiHost → claude models use anthropic-messages - geminiApiHost → gemini models use google-generative-ai This ensures only providers that explicitly support a vendor's native API will route models to that protocol. Providers like dmxapi (anthropicApiHost only) won't accidentally route gemini models to google-generative-ai. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
getBaseUrlForApiType now uses provider.geminiApiHost when the API type is google-generative-ai, ensuring the correct endpoint is written to openclaw.cherry.json. Also fix AihubmixAPIClient test that was missing geminiApiHost in the mock provider. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
…PIClient Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
Existing aihubmix providers stored in Redux lack the geminiApiHost field. Add a migration to inject the default value, matching the pattern used for anthropicApiHost in migration 172. Also add a fallback in AihubmixAPIClient to prevent undefined errors for edge cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
- Update aihubmix geminiApiHost from /gemini to /gemini/v1beta in providers config and migration 200 - Add migration 201 to fix geminiApiHost for users who already ran migration 200 with the old URL - Revert AihubmixAPIClient to use hardcoded gemini URL (not provider field) - Bump persist version to 201 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: chenxue <DDU1222@users.noreply.github.com>
kangfenmao
reviewed
Mar 11, 2026
| return state | ||
| } | ||
| }, | ||
| '200': (state: RootState) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Before this PR:
After this PR:
Fixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Breaking changes
If this PR introduces breaking changes, please describe the changes and the impact on users.
Special notes for your reviewer
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note