Skip to content

fix(models): keep catalog capabilities with their routes - #144180

Merged
steipete merged 1 commit into
mainfrom
codex/catalog-overlay-preserve-route
Sep 10, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/catalog-overlay-preserve-route

Conversation

@steipete

@steipete steipete commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Related: #130706, #142100.

What Problem This Solves

The model-selection catalog duplicated the shared metadata merger. When a configured API or endpoint changed, that copy could retain capabilities and a prepared thinking policy from the previous route. It also failed to apply an explicit thinking-level map.

Why This Change Was Made

Use the existing catalog overlay owner, including its route-change checks, and clear the old thinking-policy fields with the other route-bound metadata. Keep the captured catalog row's original transport until final route projection. That preserves rejection of incompatible donors, including rows missing an API or endpoint.

This removes eight production lines across two files. The documentation describes the resulting route and thinking-map behavior. Configuration, storage, and plugin APIs are unchanged.

User Impact

Model selection no longer carries the previous route's capabilities and thinking policy across a configured route change. Explicit thinking maps are retained. Compatible routes keep their existing capability and compatibility precedence.

Evidence

  • The original source failed five intended cases; seven controls passed, including missing-route fields, explicit pins, and provider defaults.
  • The candidate passed all 355 focused tests across eight files, including the complete twelve-case route/selection/thinking table.
  • The full changed-file gate, full documentation checks, and independent P2 review passed on the committed source.
  • One normal full build of f1bc414c6ab7bcd8da7546fe75a22ce2be3d7a98 passed, including SDK declarations. All twelve cases passed through the emitted production exports. The source-import rejection control also passed.
  • No checkout TypeScript or fetch calls occurred. All 11,934 build files across seventeen roots remained unchanged, and all owned proof processes exited. This is compiled selection/thinking-boundary proof, not a hosted-provider request.
  • Exact-head CI remains required before landing.

An earlier attempt copied configured transport onto the captured row and allowed missing-field rows to become false capability donors. That candidate was rejected. The current change preserves the captured transport and tests the final selected projection, including property omissions. It does not add a source-binding layer or claim to repair retained-source attribution across configuration generations.

Use the shared catalog overlay for configured selection metadata while
keeping captured API and endpoint fields for final route projection.
Discard stale capabilities and prepared thinking policy on known route
changes, and carry explicit configured thinking-level maps.

Preserve literal identity, aliases, names, explicit booleans, same-route
compatibility, and final rejection of donors with missing transport.

Validation: 355 focused tests, original-source 5-fail/7-control regression
proof, complete changed gate, full docs checks, and fresh P2 review.
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 10, 2026 16:16
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 10, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 12:30 PM ET / 16:30 UTC.

ClawSweeper review

What this changes

Model selection reuses the shared catalog merger to clear capabilities from changed routes, retain original transport metadata, and apply configured thinking-level maps.

Merge readiness

✅ Ready for maintainer review

This focused fix remains necessary on current main. The shared overlay preserves donor-route identity and removes stale capabilities without changing configuration or plugin contracts; no blocking defect was found.

Priority: P2
Reviewed head: f1bc414c6ab7bcd8da7546fe75a22ce2be3d7a98

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression controls and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its body reports compiled selection/thinking-boundary verification at the reviewed head, without claiming hosted-provider execution.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its body reports compiled selection/thinking-boundary verification at the reviewed head, without claiming hosted-provider execution.
Evidence reviewed 7 items Current main still needs the fix: The fetched main revision still uses a separate selection merger that retains omitted capabilities and does not copy thinkingLevelMap.
Route ownership remains intact: Selection invokes the existing overlay with preserveBaseCompat and preserveBaseRoute. The overlay clears both thinking-policy fields on known route changes, while final projection still requires a matching physical donor.
Regression coverage exercises the composition: Twelve cases exercise configuration validation, selection, prepared thinking policy, and final projection, including explicit false values, route changes, trailing slashes, and missing transport fields. These extend existing projection tests without introducing a test-only production seam.
Findings None None.
Security None None.

How this fits together

The model catalog combines discovered capabilities with configured model settings. Selection and route projection use those rows to supply model controls and runtime metadata.

flowchart TD
  A[Discovered model capabilities] --> C[Shared catalog overlay]
  B[Configured model settings] --> C
  C --> D{API or endpoint changed?}
  D -->|Yes| E[Clear previous route capabilities]
  D -->|No| F[Retain compatible capabilities]
  E --> G[Select matching route donor]
  F --> G
  G --> H[Model controls and runtime metadata]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -8, Tests +292, Docs +2. Total +286 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 25 33 -8
Tests 1 292 0 +292
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 319 33 +286

Review metrics

Metric Value Why it matters
Production and regression coverage Production −8 lines; tests +292 lines covering 12 cases The repair removes duplicated merging while adding coverage across selection, thinking policy, and route projection.

Technical review

Best possible solution:

Keep capability merging in the shared overlay and preserve physical donor identity until final route projection.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: configure a different API or endpoint for a captured row and omit its capabilities, or supply an explicit thinking map; current main's selection merger retains stale fields or omits the map. Execution was not performed in this read-only review.

Is this the best way to solve the issue?

Yes. Reusing the existing route-aware overlay removes the competing merger while preserving same-route precedence and missing-field donor rejection.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fa90e3893a0e.

Labels

Label changes:

  • add P2: This repairs bounded model-capability errors when configured routes or thinking maps differ from captured catalog metadata.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its body reports compiled selection/thinking-boundary verification at the reviewed head, without claiming hosted-provider execution.

Label justifications:

  • P2: This repairs bounded model-capability errors when configured routes or thinking maps differ from captured catalog metadata.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its body reports compiled selection/thinking-boundary verification at the reviewed head, without claiming hosted-provider execution.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f3360e9 adds src/agents/model-catalog-metadata.ts:29 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f3360e97b02f; files: src/agents/model-catalog-metadata.ts)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 9ec6795 into main Sep 10, 2026
255 of 256 checks passed
@steipete
steipete deleted the codex/catalog-overlay-preserve-route branch September 10, 2026 16:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
Use the shared catalog overlay for configured selection metadata while
keeping captured API and endpoint fields for final route projection.
Discard stale capabilities and prepared thinking policy on known route
changes, and carry explicit configured thinking-level maps.

Preserve literal identity, aliases, names, explicit booleans, same-route
compatibility, and final rejection of donors with missing transport.

Validation: 355 focused tests, original-source 5-fail/7-control regression
proof, complete changed gate, full docs checks, and fresh P2 review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant