Repository navigation
fix(clawrouter): restore custom deployment model discovery - #179223
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 949c05ccbb
ℹ️ 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".
| if (discoversConfiguredEndpoint && params.source?.kind === "runtime") { | ||
| return true; |
There was a problem hiding this comment.
Resolve the opted-in endpoint with normalized provider keys
When the operator uses an accepted noncanonical key such as models.providers.ClawRouter or models.providers[" clawrouter "], this guard finds the custom baseUrl through findNormalizedProviderValue and now admits runtime discovery, but ClawRouter's configuredBaseUrl() reads only the exact providers.clawrouter property. The catalog hook consequently falls back to https://clawrouter.openclaw.ai and sends the custom deployment's discovery credential there instead of querying the configured deployment. Normalize the provider lookup used by the hook, or pass the endpoint admitted here through to acquisition.
AGENTS.md reference: AGENTS.md:L65-L65
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. What this changesRestore credential-scoped discovery for custom ClawRouter deployments while keeping hosted static capabilities and retained catalogs endpoint-scoped. Example: ClawRouter is configured at http://127.0.0.1:43127/private and grants codex-latest.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness⛔ Blocked before merge - 5 items remain This PR addresses a current discovery regression and should stay open, but the endpoint lookup mismatch identified in the existing review remains actionable. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherProvider discovery combines plugin metadata, configured endpoints, and selected credentials into model inventory; generated inventory is retained in the existing per-agent SQLite cache and consumed by CLI and Gateway model surfaces. flowchart TD
A[Provider configuration and credentials] --> B[Catalog eligibility owner]
C[Plugin manifest] --> B
B --> D[ClawRouter live catalog hook]
D --> E[Configured deployment HTTP catalog]
E --> F[Catalog planning and SQLite cache]
F --> G[CLI and Gateway model inventory]
Technical reviewBest possible solution: Keep the shared discovery exception and endpoint-bound cache, and make ClawRouter resolve the configured endpoint with the same normalized provider lookup used for admission. Do we have a high-confidence way to reproduce the issue? Source establishes both the current-main custom-endpoint exclusion and the introduced mixed-case lookup mismatch; no target code was executed during this read-only review. Is this the best way to solve the issue? Separating live acquisition from static eligibility is appropriate and uses existing owners, but admission and acquisition must agree on the configured provider identity. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2fb9f04a6844. Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: An accepted noncanonical provider key can cause deployment credentials to reach the hosted fallback. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +79, Tests +130, Docs +6. Total +215 across 16 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 5:22 AM ET / 09:22 UTC. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6c0107b24
ℹ️ 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".
| const expectedBaseUrl = configuredBaseUrl ?? alias?.baseUrl ?? provider?.baseUrl; | ||
| const actualBaseUrl = params.source.baseUrl; | ||
| const expected = expectedBaseUrl && normalizePluginProviderBaseUrl(expectedBaseUrl); |
There was a problem hiding this comment.
Treat blank configured URLs as the default endpoint
When models.providers.<id>.baseUrl is explicitly "", planning already treats it as absent via stripBlankProviderBaseUrls, and live discovery therefore acquires the native/default endpoint. This generated-cache branch instead selects the empty string through ??, makes expected falsy, and rejects that correctly acquired retained catalog; direct model-registry reads can consequently show no cached models after restart or while live refresh is unavailable. Normalize the configured value before choosing the manifest fallback, or use the same blank-as-absent semantics as planning.
AGENTS.md reference: AGENTS.md:L62-L62
Useful? React with 👍 / 👎.
Bind opted-in runtime catalogs to their configured source origin, preserving static typed Decisions and other providers’ runtime endpoint policies. Reject retained catalogs from a replaced or removed custom origin. Repairs the catalog regression introduced by #178886 (@fuller-stack-dev). Release-note context: ClawRouter custom-origin gateways list their models again.
d6c0107 to
92b82bc
Compare
…179223) * fix(clawrouter): restore custom-origin model discovery Bind opted-in runtime catalogs to their configured source origin, preserving static typed Decisions and other providers’ runtime endpoint policies. Reject retained catalogs from a replaced or removed custom origin. Repairs the catalog regression introduced by openclaw#178886 (@fuller-stack-dev). Release-note context: ClawRouter custom-origin gateways list their models again. * Merge origin/main and preserve the custom-origin regression boundary * test(clawrouter): keep catalog regression independent of overlapping tests
What Problem This Solves
ClawRouter-managed Gateways configured with
models.providers.clawrouter.baseUrlcan finish readiness successfully but list zero models. This repairs the regression introduced by #178886 (@fuller-stack-dev): the static typed Decisions catalog's default service URL excluded the documented custom deployment origin during runtime catalog discovery.Why This Change Was Made
Keep admission in
isProviderCatalogSourceAllowed. The optional manifest fieldconfiguredEndpointDiscoveryopts an owned runtime provider into source-origin binding; only ClawRouter opts in. Discovery uses the configured origin, or the manifest default when an override is removed. Returned and retained inventory must match that origin's scheme, host, and port before config merging. Aliases use the canonical provider ID. Foreign and malformed sources remain rejected; static capability declarations retain their endpoint restrictions. Non-opt-in providers retain their previous policy, including OpenAI subscription and environment-selected origins.Stored provider URLs already preserve acquisition origin, so no second cache or source-identity state is needed. Both E2E fixtures now use the unmodified bundled manifest. The managed test preserves explicit Gateway-port routing and checks the exact discovered inventory. Typed Decisions production code and its tests are unchanged.
This replaces the stalled PR implementation with an owner-level repair. No SQL, schema, migration, plugin-loading, service-lifecycle, or SDK subpath change; the additive manifest contract is documented. No performance or SQL reduction is claimed. Against integrated base
6213de693cfc: 13 files, +188/-73; production/manifest +59/-16, tests +125/-57, docs +4. The E2Es delete endpoint-rewriting fixture machinery; the remaining growth protects distinct source, retained-inventory, and manifest boundaries.Evidence
Acceptance, recorded before the runs: the original managed-Gateway flow must fail with zero models on the base and pass three runs on the candidate; custom and aliased origins must be admitted while foreign origins remain rejected; retained inventory must not cross origins or survive removing a custom override; typed Decisions and prompt-prefix tests must pass.
0fa467ef0d07: readiness succeeds, then the unchanged managed-Gateway test fails withcount: 0, models: []. The source-gate regressions also fail on this base.92b82bca975f: supported QA runtime build passed; all three strengthened managed-Gateway runs passed. The unmodified-manifest cold-worker suite passed all four cases.unavailablefor the default selector while the per-agent selector passed. Its exact cause remains unresolved; passing replays are not claimed as a repair. Original deadlines and assertions are unchanged.c6bdd97f283149504108a4863b56dbb62f3f36cdonly relocates the unchanged normalization test to avoid widening an existing conflict. All six changed production/manifest blobs and runtime-test inputs match the proven candidate. Final exact-head CI 40291914247, attempt 2: 48 jobs passed, 28 skipped, and only UI shard 6 plus its downstream aggregate failed. All selected static, type, lint, and security jobs passed.Open-PR merge-tree comparison against the same integrated base: #165915 remains conflict-free; #158582 retains 85 existing conflict blocks, #155667 retains 21, #145839 retains 4, and #143781 retains 33. No new conflict path or block in any peer. The normalization test was moved unchanged to preserve #155667's existing blocks byte-for-byte.
User Impact
ClawRouter custom-origin gateways list their models again. The configured deployment supplies runtime inventory, while typed Decisions declarations remain endpoint-scoped. No configuration migration is required.
CI Exception
The final-head UI shard fails during setup for
ui/src/e2e/stale-build-recovery.production.e2e.test.ts, before its browser assertion: the existing helper runsnode scripts/run-node.mjs --helpto prepare a missing runtime and exceeds its unchanged 120-second limit. The parent timeout then terminates tsdown. This same test passed in 116,197 ms on the production-identical earlier head in CI 40288685378. Its fixture, helper, and build-owner inputs are unchanged by this PR.One diagnosed infrastructure rerun on the unchanged final head repeated exactly that setup timeout (job 121475507271); no further retries or timeout changes were made. The coordinator explicitly attributed this as an unrelated setup flake, approved the admin landing exception if it repeated, and assigned the runtime-preparation fix to STALEBUILD. Landing uses that scoped exception; final-head CI is not claimed green.