feat(providers): add ClawRouter routing and quotas#99658
Conversation
|
Codex review: found issues before merge. Reviewed July 3, 2026, 9:25 PM ET / 01:25 UTC. Summary PR surface: Source +746, Tests +540, Docs +219, Config +36, Other +7. Total +1548 across 30 files. Reproducibility: not applicable. this is a new provider integration PR, not a broken existing behavior report. Current-main search confirms the requested ClawRouter plugin and usage provider entries are absent. Review metrics: 3 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land only after removing the normal-PR changelog entry, resolving the alternate ClawRouter design PR, maintainer product/security approval, and successful PR-head validation for the provider/quota path. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a new provider integration PR, not a broken existing behavior report. Current-main search confirms the requested ClawRouter plugin and usage provider entries are absent. Is this the best way to solve the issue? Unclear as a final merge state: the provider-owned plugin uses existing SDK seams and matches the ClawRouter source contract, but maintainers still need to accept this model-ref direction over #94012 and refresh PR-head validation. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b38155918447. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +746, Tests +540, Docs +219, Config +36, Other +7. Total +1548 across 30 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b2632348f
ℹ️ 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".
| params: { | ||
| [ROUTE_METADATA_KEY]: { | ||
| api, | ||
| baseUrl, | ||
| ...(upstreamModel ? { upstreamModel } : {}), |
There was a problem hiding this comment.
Preserve route metadata for overridden ClawRouter models
When a user adds an explicit model row for a discovered ClawRouter model (for example to tune maxTokens), mergeProviderModels keeps the explicit row and only copies a small set of fields from the implicit row, so the params.clawrouterRoute written here is dropped. For native Anthropic/Gemini catalog rows, normalizeClawRouterResolvedModel then has no route metadata, leaving the provider-level OpenAI /v1 transport and never rewriting to the upstream model id, so those overridden models hit the wrong endpoint or fail. Keep this routing metadata outside user-overridable params or merge it into explicit rows.
Useful? React with 👍 / 👎.
* feat(providers): add ClawRouter routing and quotas * docs(plugins): refresh Ollama inventory * test(plugins): register ClawRouter boundary coverage * docs(i18n): add ClawRouter glossary terms * docs(providers): expand ClawRouter setup guide
Fixes #99657.
What Problem This Solves
OpenClaw could not consume ClawRouter's credential-scoped model catalog or show its managed quota. Manual provider duplication also lost ClawRouter's per-key access boundary.
This is a smaller, provider-owned alternative to #94012. The package is
@openclaw/clawrouter, without the-providersuffix.Why
ClawRouter owns upstream credentials and publishes the authorized model/transport catalog. OpenClaw should reuse its existing transport implementations where the wire contracts match, while refusing catalog rows whose native protocol OpenClaw cannot safely produce.
User Impact
CLAWROUTER_API_KEYdiscovers only models granted to that key.clawrouter/<provider>/<model>.Evidence
clawrouter/openai/gpt-4.1-minireturned the exactOPENAI_OKmarker.clawrouter/anthropic/claude-haiku-4-5returned the exactANTHROPIC_OKmarker.clawrouter/google/gemini-3.5-flashreturned the exactGOOGLE_OKmarker.check:changed: providerblacksmith-testbox, leasetbx_01kwmzbskxx0ywxdtq8097mpky, succeeded in 6m14s. Actions evidence.Deployment Status
The current ClawRouter Worker is deployed at
https://clawrouter.openclaw.ai; its upstream smoke is green. This PR changes OpenClaw only and requires no ClawRouter redeploy.Remaining Risk
Native Bedrock InvokeModel, Cohere v2, and Cloudflare universal-envelope rows remain intentionally unadvertised until ClawRouter normalizes them to an OpenClaw-supported transport.