Repository navigation
fix: keep custom model routes on their declared tool surface - #156017
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: needs maintainer review before merge. Reviewed September 24, 2026, 7:24 AM ET / 11:24 UTC (Revision 8). ClawSweeper reviewWhat this changesThe branch selects model capabilities by provider API and endpoint during config loading and runtime resolution, recognizes equivalent Anthropic URLs, and adds route, Doctor, and operator guidance. Merge readiness✅ Ready for maintainer review Current main still applies catalog compatibility across custom endpoints, so this PR remains useful. The recorded compatibility tradeoff is accepted, and this review found no concrete introduced defect. Priority: P2 Review scores
Verification
How this fits togetherProvider settings, plugin catalog metadata, and model discovery feed OpenClaw's model resolver. Its selected compatibility flags determine the agent's Code Mode or Tool Search controls; Doctor can also remove redundant flags from saved config. flowchart LR
A[Provider settings] --> D[Route matching]
B[Plugin catalog] --> D
C[Model discovery] --> D
D --> E[Compatibility selection]
E --> F[Agent tool surface]
D --> G[Doctor config cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +24, Tests +326, Docs +4, Other 0. Total +354 across 10 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep capabilities owned by the selected endpoint across runtime resolution and Doctor, while preserving explicit custom declarations and backup-safe upgrades. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows catalog compatibility seeded without a route check, and the affected tool-surface decision is explicit; this read-only review did not execute the path. Is this the best way to solve the issue? Yes. The patch uses the existing route-compatibility owner and explicit custom compatibility setting, without adding a competing configuration surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a533ff8f836e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer disposition: accept the route-owned compatibility behavior described in this review. Reusing a model ID at a different API or base URL does not establish that the new endpoint supports the original catalog route's capabilities; the existing route-compatibility owner and provider documentation already define that boundary. Existing custom endpoints that relied on inherited automatic Code Mode will use the normal tool-search controls. Operators who want automatic Code Mode on a verified custom endpoint can retain it with the existing explicit This resolves the review's compatibility disposition. Code review, source-bound validation, and the ordinary native merge gates still apply. |
Reuse Anthropic endpoint normalization and select the final route catalog donor, including provider-only overlays. Preserve explicit custom endpoint declarations and keep Doctor cleanup bound to matching catalog routes.
|
Merged via squash.
|
…w#156017) * fix: keep custom model routes on their declared tool surface * fix(models): preserve compatibility on equivalent configured routes Reuse Anthropic endpoint normalization and select the final route catalog donor, including provider-only overlays. Preserve explicit custom endpoint declarations and keep Doctor cleanup bound to matching catalog routes.
What Problem This Solves
Custom model endpoints could inherit the standard catalog endpoint's compatibility flags. Inherited Code Mode preference could suppress Tool Search even when the custom endpoint did not support the same tool behavior. Config materialization and runtime resolution now use the endpoint that owns those capabilities.
User Impact
Catalog capabilities apply to their matching API and physical endpoint. Equivalent Anthropic
/v1and/v1/spellings retain the canonical endpoint's capabilities. When configuration selects catalog endpoint A after discovery returned endpoint B, resolution selects A's catalog capabilities, including provider-only overlays with no model row. Same-endpoint discovery keeps its refreshed metadata.Upgrade note: Custom endpoints that implicitly borrowed
codeMode: "preferred"now use the normal Tool Search controls. An endpoint verified to support Code Mode can retain the existing explicitmodels.providers.<provider>.models[].compat.codeMode: "preferred"setting. Other endpoint-specific flags, includingsupportsTemperature, also belong in the custom endpoint's existingcompatdeclaration. No new configuration field is introduced.Why This Change Was Made
Keep compatibility decisions at the existing catalog and transport owners. Reuse Anthropic endpoint normalization and consult the existing static catalog lookup only when discovery's endpoint differs from the selected endpoint. Doctor retains its unique-route and equality checks when removing redundant compatibility declarations; divergent and custom declarations remain protected.
Related: #154964, whose Gateway/MCP proof exposed the original defect.
Evidence
The published-updater proof passed on the unchanged candidate tree. The released
2026.9.4updater installed the canonical2026.9.5candidate and ran its Doctor. Before any manual Doctor invocation, the original config's exact.pre-updatebackup was verified, only the matching canonical compatibility declaration was removed, divergent temperature and custom-endpoint Code Mode declarations were preserved, and the selected model stayed unchanged. Two subsequent Doctor passes retained identical config bytes. The complete installed-update cell took 85.309 seconds; the updater command itself took 48.401 seconds. This used isolated state and--no-restart, with the updater's own staged validation and canary. Installed model status proves selection; the resolver tests prove compatibility behavior. The initial fixture failure was an incorrect expectation that postinstall retained its consumed lifecycle marker; it was corrected without changing product code, and all other packaged-file hashes remained checked.Current-head CI35977015261 passed for
dd15d1a17c35b499b2c4d400ad5a0f18e10ec313(140 successful jobs; 16 skipped). In CI, summed reported case times were 0.053 seconds for the 15 route cases, 0 milliseconds at reporter precision for the 4 catalog cases, 0.002 seconds for the 21 defaults cases, and 0.373 seconds for the 24 migration cases. These exclude file setup/import/teardown; CI file wall times were not available. The standalone file walls above remain the measured total command costs.Earlier composed Gateway/MCP proof for the original route fix passed with four tool-bearing requests exercising Tool Search, description, and the real MCP call. That proof predates the added alias and discovery cases; its temporary fixture overlay is excluded from this PR. Earlier CI35798278130 failed plugin-state and session-group fixtures; the reproduced failures were repaired by 8ce411c1 and 46dfea6a, both already included in this branch. CI35806084181 passed on the previous head
355ca68a; those historical results are not presented as current-head CI.