Repository navigation
fix(agents): retain admitted routes for native model selection - #170639
Conversation
Reuse the existing admitted catalog capture when a projected runtime snapshot retains its catalog identity. This preserves account model transport and runtime policy evidence through auth planning without weakening harness support checks.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 059db6e3f8
ℹ️ 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 routeCatalog = | ||
| (borrowedSnapshot && | ||
| borrowedSnapshot.modelCatalog === params.preparedModelRuntime?.modelCatalog | ||
| ? readAdmittedPublishedModelCatalog(borrowedSnapshot) | ||
| : undefined) ?? catalog; |
There was a problem hiding this comment.
Prefer routes returned by on-demand native discovery
When a user-selected native model is absent from the admitted catalog, loadNativeModelCatalog() replaces catalog with the newly discovered model and its transport routes. Because the projected runtime still shares modelCatalog identity with the borrowed snapshot, this branch nevertheless selects the older admitted catalog, where that model has no variants, so observedRoutes becomes undefined and auth planning can reject the profile or choose the wrong endpoint. Use the admitted published catalog only when catalog has not been replaced by on-demand discovery.
AGENTS.md reference: src/agents/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
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. |
Account-only models admitted through the Codex catalog can be rejected before inference because their transport route is lost. Regression commit `57244cbcd2d3ffa24d7339e6bc459f7f19cf3d53` (openclaw#168789) removed the published-catalog handoff. Native capability rows intentionally omit transport fields, while the admission capture retains route evidence separately; projecting the runtime snapshot loses the object identity used to retrieve that evidence. Reuse the existing borrowed admission snapshot when it shares the projected snapshot's catalog identity. This preserves the route, OAuth profile forwarding, and runtime compatibility evidence captured for the turn. Auth planning and harness support checks remain unchanged, including rejection of unsupported routes. No new catalog owner, database access, or model allowlist is introduced. The regression exercises catalog capture followed by snapshot projection through runtime preparation and verifies native ownership, the subscription route, OAuth profile forwarding, and compatible runtime IDs. Scope: two files, **+92/−3** overall (**+17/−2** production). Validation: - One isolated Codex review completed with no actionable P0–P2 findings. - Formatting, whitespace checks, and normal commit hooks passed. - Local lint stopped during configuration loading because `eslint-plugin-solid` could not be resolved. Exact-candidate [hosted proof](https://github.com/openclaw/openclaw/actions/runs/38347218098/job/115131307024) subsequently passed targeted type-aware lint with zero warnings or errors. - The same hosted job passed the complete ownership test file, 32/32 with no skips, including the new admitted-route regression (99.47 seconds Vitest, 139.53 seconds runner wall). - The separate [product proof](https://github.com/openclaw/openclaw/actions/runs/38347218098/job/115131307190) built the private QA runtime and passed the complete unchanged three-case account-model route file, 3/3 with no skips (171.35 seconds Vitest, 174.90 seconds runner wall). Candidate and test-file blob were verified from the hosted log. - Ordinary [CI 38347219340](https://github.com/openclaw/openclaw/actions/runs/38347219340) completed successfully: 35 jobs passed and 26 were skipped. Build artifacts, production types, all selected test types, lint, source contracts, boundaries, and the aggregate gate passed. Madge found zero cycles; T1 stayed 455→455, compatibility calls 9→9, and the dialect ratchet 0→0. Knip, the published-driver cell, and SDK diff were unselected; no fresh pass is claimed for those. The change adds no exports, SDK surface, or database calls.
Account-only models admitted through the Codex catalog can be rejected before inference because their transport route is lost. Regression commit
5d6cf7424de268b0354e3b1c4bfae81e20bdd99c(#168789) removed the published-catalog handoff. Native capability rows intentionally omit transport fields, while the admission capture retains route evidence separately; projecting the runtime snapshot loses the object identity used to retrieve that evidence.Reuse the existing borrowed admission snapshot when it shares the projected snapshot's catalog identity. This preserves the route, OAuth profile forwarding, and runtime compatibility evidence captured for the turn. Auth planning and harness support checks remain unchanged, including rejection of unsupported routes. No new catalog owner, database access, or model allowlist is introduced.
The regression exercises catalog capture followed by snapshot projection through runtime preparation and verifies native ownership, the subscription route, OAuth profile forwarding, and compatible runtime IDs. Scope: two files, +92/−3 overall (+17/−2 production).
Validation:
eslint-plugin-solidcould not be resolved. Exact-candidate hosted proof subsequently passed targeted type-aware lint with zero warnings or errors.