Repository navigation
fix: preserve exact model identity in SDK catalog lookups - #139907
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: blocked before merge. Reviewed September 6, 2026, 4:03 AM ET / 08:03 UTC. ClawSweeper reviewWhat this changesModel catalog lookups prefer exact canonical IDs, retain unique case-insensitive matches, reject ambiguous matches, and consolidate identity and thinking regression coverage. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, bounded fix: current main and the latest release retain the reported lookup defect. No introduced correctness or security findings remain, and the discussion resolves the previous compatibility decision. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s model catalog supplies model metadata to plugins and runtime consumers. These lookup helpers select a catalog record from a provider and model ID, affecting capability and model-selection decisions. flowchart TD
A[Plugin or runtime request] --> B[Provider and model ID]
C[Model catalog records] --> D[Provider filtering]
B --> D
D --> E[Canonical identity match]
E -->|Found| F[Selected model metadata]
E -->|Missing| G[Unique case insensitive match]
G -->|Unique| F
G -->|Ambiguous or absent| H[No match]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +13, Tests +54. Total +67 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical identity lookup with the existing SDK signature, unique case-insensitive compatibility, and the explicitly accepted ambiguity correction. Do we have a high-confidence way to reproduce the issue? Yes: current-main source deterministically selects Reader for an exact reader request when Reader appears first. The PR records matching public-package reproduction; this review did not execute it. Is this the best way to solve the issue? Yes: repairing the shared lookup with the existing canonical identity owner is narrow, preserves unique fallback behavior, and avoids introducing another SDK path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 379f0533efb9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Accepting the documented ambiguity correction for this scoped repair. The public SDK keeps its existing signature and accepts uniquely identifiable case-insensitive requests. When multiple case-distinct identities match a non-exact request, the caller must supply the intended exact ID. Returning an arbitrary record would preserve the reported metadata-selection defect. The current-main and published-package probes establish the prior behavior; the candidate public-package and independent acceptance probes establish exact selection, unique fallback compatibility, and explicit ambiguity. No claim is made that unknown third-party callers have been exhaustively audited. This bounded compatibility change is explicit in the PR's User Impact and is part of the approved exact-identity extraction. This addresses the compatibility decision in #139907 (comment). The review reports no code or security findings and no rank-up changes. The clean exact-head local review reaches the same technical result. No source or PR-body change is needed. |
|
Landed in b561409. SDK hardening: exact provider/model identity now wins before the uniquely identifiable case-insensitive fallback. Ambiguous requests return no match instead of another model's record.
The documented ambiguity compatibility choice is accepted in #139907 (comment). Source draft #136257 remains separate and untouched. |
…39907) Prefer canonical exact model identity before the unique case-insensitive SDK fallback. Keep provider boundaries and providerless ambiguity explicit. SDK hardening proved through the built public package, baseline regressions, sibling tests, and isolated command-line compatibility controls. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257.
What Problem This Solves
Plugin model lookup could return a different model when identifiers differed only by case. This is public developer-interface hardening; no channel or Gateway failure was reproduced.
Why This Change Was Made
Shared lookup scopes the provider first and prefers exact identity. The existing case-insensitive fallback applies only when it identifies one row. Provider aliases, exact duplicate precedence, and the public signature remain intact.
User Impact
Plugins receive the requested model's metadata regardless of catalog order. Ambiguous requests return no match. Compatibility decision.
Evidence
Public-package checks reproduced the wrong identity on main and release 2026.9.2. The fix returned each exact row in either order and rejected ambiguous lookup. Four regressions failed before the change; all 233 focused tests passed afterward. Public acceptance covered 77 lookups and three catalog builds. Local CLI inference controls used a synthetic endpoint.
Consumers: public model lookup now applies exact precedence and rejects ambiguous fallback.