Repository navigation
refactor(models): share selector reference traversal - #139571
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 5, 2026, 9:17 PM ET / September 6, 2026, 01:17 UTC. ClawSweeper reviewWhat this changesShares read-only traversal of configured primary and fallback models between model discovery and Doctor, preserving existing reference handling. Merge readiness⛔ Blocked before merge - 1 item remains The maintainer-requested cleanup remains useful and is not present on inspected main. No actionable defect was found. The earlier migration-proof blocker is unsupported by this diff: traversal changes preserve existing outputs, and mutation and persistence semantics remain unchanged. Priority: P3 Review scores
Verification
How this fits togetherModel selectors contain a primary model and optional ordered fallbacks. OpenClaw reads these references for model discovery, startup requirements, and Doctor diagnostics and repairs. flowchart TD
A[Configured model selectors] --> B[Shared reference traversal]
B --> C[Raw model references]
B --> D[Paths and primary or fallback roles]
C --> E[Model discovery and startup]
D --> F[Doctor reference collectors]
F --> G[Existing diagnostics and repair owners]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -46, Tests +9. Total -37 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one read-only selector traversal while leaving field inventories, normalization, and mutation decisions with their existing owners. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing readers and does not claim to repair a new observable defect. Is this the best way to solve the issue? Yes. The shared visitor removes duplicate traversal while preserving caller-specific semantics; inspected callers do not consume the removed return values. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1d9ce1ac9ffa. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
5ef5867 to
ac0fe5a
Compare
|
Merged via squash.
|
* origin/main: (302 commits) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) test(text): consolidate literal sanitizer cases (#139579) test(gateway): observe native drain without a lint exception (#139576) test(memory): consolidate visibility fixtures without policy defaults (#139569) fix(ui): show shimmer skeletons while loading Control UI (#139525) test(qa): make cleanup child logging deterministic (#139566) test(cli): keep Unix socket fixtures within path limits (#139565) fix: avoid slow incognito key checks in large session stores (#139528) feat(macos): open Gateway windows from the Gateways menu (#139522) test(workshop): isolate marker casing fixture identities (#139554) fix(process): require cleanup evidence before releasing owned work (#139517) ... # Conflicts: # scripts/release-check.ts
* commit '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) test(text): consolidate literal sanitizer cases (#139579) test(gateway): observe native drain without a lint exception (#139576) test(memory): consolidate visibility fixtures without policy defaults (#139569) fix(ui): show shimmer skeletons while loading Control UI (#139525) ...
* commit 'refs/openclaw/tasks/pr-135167-main': (2467 commits) refactor(ios): reuse shared integer conversion (#139581) fix(sessions): prevent database lock failures during reclamation (#139469) perf(test): reuse transforms within owned scheduler slots (#139553) test(agents): share sparse transcript input fixtures (#139589) chore(ui): refresh control ui locales (#139481) fix(slack): keep prototype-named emoji shortcodes intact (#136374) fix(gateway): deliver upgrade rejection responses under Bun (#139516) refactor(test): simplify catalog guards and fix native report fixture (#139496) fix(macos): prevent dashboard fixture loopback timeouts (#139556) fix(matrix): preserve selected reply targets inside threads (#139479) test(gateway): preserve held-work close failures (#139593) refactor(exec): share package argument scanning (#139560) fix(audit): preserve sequence range validation before numeric decoding (#139587) fix(transcripts): retain capture ownership through failed cleanup (#139572) refactor(models): share selector reference traversal (#139571) perf(agents): classify allowlists without intermediate sets (#138392) chore(release): update appcast for 2026.9.2 (#139575) fix(ci): synchronize cloud retries and board widget input (#139506) fix(plugins): explain SDK incompatibilities after core updates (#139458) fix(voice-call): retain installed WebSocket behavior under Bun (#139567) ...
What Problem This Solves
Maintainer-requested follow-up to #139523. Five readers repeated the scalar/primary/fallback traversal for model selectors. Keeping those copies aligned made model discovery and Doctor repair harder to maintain.
Why This Change Was Made
One read-only visitor in the private model-catalog package now owns selector traversal. Callers retain their field inventories, trimming rules and primary-only runtime attribution. The cleanup also removes unused boolean bookkeeping from Doctor collectors. Existing mutation helpers keep their current behavior and ownership.
User Impact
No behavior change intended. Raw values, blank and duplicate ordering, original fallback indices, model inventories and migration behavior are preserved. No operator configuration, provider policy, stored representation, schema, protocol or dependency change.
Evidence
node scripts/run-vitest.mjs. Coverage includes model-catalog readers, Doctor warnings/migrations, startup providers and harness routing.ac0fe5a99108ffe0216f9cbc655bcc3afb6d5817is scoped-clean P0–P2.5ef586738dcd386c387e2a5ed9e78b841f448e57: two baseline HTTP400 calls, two guarded failures with zero inference requests, typed history/actionable notices, persisted Doctor clear, and success on the unchanged default. Lease stopped.tbx_01m1t3xamzynmp61kddhz8eddv, passed on verified sourceac0fe5a99108ffe0216f9cbc655bcc3afb6d5817. Candidate and baseline full builds passed; source/tree identities were verified before and after execution. The native run exited 0. A later portal synchronization timeout did not affect the command or verdict.git diff --numstat: production +45/−91 (net −46); tests +15/−6 (net +9). Three files, no generated or dependency changes.Final live-proof transcript (synthetic HTTP provider and capture channel, real public CLI and isolated Gateway; free ports and task-owned state):
{"status":"pass","candidateSha":"ac0fe5a99108ffe0216f9cbc655bcc3afb6d5817","beforeProviderRequests":2,"guardedRuns":2,"guardedProviderRequests":0,"failureCode":"model_not_found","deliveredRemedyNotices":2,"overrideCleared":true,"agentDefaultUnchanged":true,"recoveredStatus":"ok","sourceIdentityVerifiedAfterRun":true}This completes the requested separate refactor pass. No additional refactor is needed in these reader paths. Related bug/reporters remain credited in #139523 and #139235 (@alessi0p on X and Séraphin on Discord).