Repository navigation
fix(openrouter): unsupported models incorrectly receive tool definitions - #129659
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 16, 2026, 8:36 PM ET / September 17, 2026, 00:36 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR makes discovered OpenRouter models advertise their actual tool support, adds request-payload regression coverage, and documents behavior when capability metadata is absent. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main and v2026.9.4. The refreshed patch resolves the earlier stale-catalog concern, preserves reasoning metadata, and introduces no actionable correctness finding. Maintainer-authored work also remains protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherOpenRouter’s catalog supplies model capabilities to OpenClaw’s provider plugin. Those capabilities control whether the shared request builder includes tool definitions and tool choice. flowchart TD
A[OpenRouter model catalog] --> B[Provider catalog adapter]
B --> C{Tool metadata present?}
C -->|Yes| D[Advertised tool capability]
C -->|No| E[Existing default behavior]
D --> F[Shared request builder]
E --> F
F --> G[Request with or without tools]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +57, Docs +5. Total +62 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep tool capability catalog-owned and consistently consumed by the existing transport, preserving absent-metadata defaults and reasoning controls. Do we have a high-confidence way to reproduce the issue? Yes, from source: a discovered model with supported_parameters: [] receives no supportsTools flag on current main, so the managed request builder includes supplied tools. This review did not execute that path. Is this the best way to solve the issue? Yes. Populating the existing compatibility field at discovery is a narrow repair that matches the dynamic resolver and reuses the established transport guard without adding an API or configuration option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 00837c258f61. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
25a6449 to
aeeb972
Compare
|
Merged via squash.
|
What Problem This Solves
Fixes invalid tool definitions being sent to discovered OpenRouter models whose advertised capabilities explicitly omit tool support.
User Impact
Models without tool support receive tool-free requests. Tool-capable models, the automatic router, and models without explicit capability metadata keep working as before; reasoning controls and pricing remain intact.
Why This Change Was Made
The live catalog now carries OpenRouter's existing
supported_parameterscontract into model compatibility, matching the dynamic-model resolver. The refreshed change merges that capability with the current reasoning metadata instead of replacing it.Evidence
OpenRouter documents the capability in its models API and tool-calling guide.