Skip to content

fix(agents): retain admitted routes for native model selection - #170639

Merged
steipete merged 1 commit into
mainfrom
dbasync/redmain-account-model-routes
Oct 13, 2026
Merged

steipete merged 1 commit into
mainfrom
dbasync/redmain-account-model-routes

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • 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 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 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 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Oct 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +417 to +421
const routeCatalog =
(borrowedSnapshot &&
borrowedSnapshot.modelCatalog === params.preparedModelRuntime?.modelCatalog
? readAdmittedPublishedModelCatalog(borrowedSnapshot)
: undefined) ?? catalog;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T04:39:47.151659Z 059db6e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 75bc910 into main Oct 13, 2026
119 of 124 checks passed
@steipete
steipete deleted the dbasync/redmain-account-model-routes branch October 13, 2026 04:52
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant