Repository navigation
fix: refresh model availability after stored-account quota recovery - #146691
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 13, 2026, 12:00 AM ET / 04:00 UTC (Revision 3). ClawSweeper reviewWhat this changesRefreshes stored-account model availability in retained catalogs and chat metadata after quota blocks change, while preserving prepared credentials and provider discovery. Merge readiness⛔ Blocked before merge - 1 item remains Keep open as a useful fix for the linked quota-recovery issue. The previous mock-export finding is resolved, no remaining actionable defect was found, and current main still lacks this repair. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s prepared model catalog combines discovered models with account readiness. The Gateway projects those facts into model lists and chat metadata consumed by the Control UI. flowchart TD
A[Stored-account usage updates] --> B[Published auth snapshots]
B --> C[Matching credential and owner check]
D[Retained model catalog] --> C
C --> E[Current availability projection]
E --> F[Gateway model lists]
E --> G[Chat metadata and Control UI]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +108, Tests +354. Total +462 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep availability current through the existing snapshot and metadata owners without rotating credentials, repeating discovery, or changing stored state. Do we have a high-confidence way to reproduce the issue? Yes: retained full-catalog auth and unchecked usage revisions explain stale availability on current main, and the existing quota-reset browser case supplies a concrete reproduction path. This review did not execute it. Is this the best way to solve the issue? Yes: refreshing usage at the existing owner boundary repairs the reported behavior while retaining credential identity, selection policy, and discovery results. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f5d9acfa706c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
The data-model compatibility check is satisfied without a migration: this patch changes transient catalog projections, not persisted state.
There is no new persisted format for an older or upgraded process to interpret. I have added this compatibility evidence to the PR description. The separate startup mock completeness fix passes all 12 cases on Linux. The shared main typecheck repair landed through #146689, and fresh exact-head CI is running. The current ClawSweeper review reports no remaining actionable code defect; its repeated compatibility checklist is covered by these unchanged-format checks, so no migration is applicable. |
|
The shared TS6133 compile blocker is repaired on main by #146689 at 4c47e8a06e57, with exact-head CI green. #146698 was the identical one-line import cleanup and is now closed as already fixed; its public re-export is preserved. This PR can now refresh against repaired main. Our CI optimization PR #146550 observes the same automatic-recovery |
|
@clawsweeper re-review The current head adds only the missing startup-static mock export. All 12 startup cases pass on Linux, and targeted lint, test types, formatting, and fresh independent P2 review pass. The production repair is unchanged. The prior data-model compatibility request is addressed in the PR body and the existing compatibility comment: persisted types, serialization, usage writers, schemas, and migrations are unchanged; the reader and its WeakMap binding operate only on published process snapshots. The unrelated main import failure is fixed by #146689. Fresh exact-head CI is running. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…penclaw#146691) * fix: refresh model availability after stored-account quota recovery * test: complete the static catalog auth snapshot fixture
Closes #146662
Related: #146587
What Problem This Solves
Fixes models remaining unavailable after a successful turn clears a stored-profile quota block, leaving the Control UI showing
Signed ininstead ofReady.User Impact
Catalog and chat metadata reflect added, cleared, and reapplied stored-profile blocks without restarting or repeating provider discovery. Credential ownership and selection rules are preserved; no configuration or storage migration is required.
The next required chat metadata read after a usage update rebuilds its prepared generation. Synthetic measurements put that read at approximately 2 ms for one model, 18 ms for 32, 162 ms for 293, and 115 ms for eight agents with 32 models each. Stable reads remain close to baseline.
Config-only inline API-key health retains its existing freshness behavior. It has no stored-profile identity and is outside this repair's scope.
Why This Change Was Made
Retained catalogs paired current discovery with an older usage snapshot. Their existing auth owner now reads current usage from captured, still-owned stores with matching credentials. Copies retain that binding; retired owners and delayed workers cannot acquire replacement authority.
Chat metadata checks requested and inherited usage revisions before reuse and after asynchronous projection. Optional startup reads remain nonblocking while required reads perform the existing refresh.
Storage compatibility is unchanged:
AuthProfileStore, persisted serialization, usage writers, SQLite schemas, and migrations are untouched. The reader only projects existingusageStatsfrom published process snapshots; its binding remains in a private WeakMap and is never serialized. The native state-schema check and worker credential/SecretRef preservation cases pass.Evidence
Ready, the CLI reports usable credentials, and the cleared block stays absent.canonicalProviderNameandlistPackagedStaticExtensionAssetOutputs); neither is changed by this PR. Initial hosted CI also hit an unrelated main import error, now fixed by fix: avoid channel discovery when plugins are disabled #146689. Fresh exact-head CI passes for the eleven-file headf59bd34c77e099cbd2e84fa76f8ae8d1f91695ef, including the required gate.Measurement scope and proof attribution
Last-used publication followed by a required metadata read, baseline → candidate median milliseconds:
These are correctness costs, not a performance-improvement claim. Measurements use synthetic providers and built-in commands, excluding installed skill/plugin commands, network, and durable storage I/O. Earlier three-second diagnostics omitted production-prepared thinking policy and are not valid production latency evidence.
Linux proof uses Node 24.19.0 on Ubuntu 26.04; hosted CI uses Ubuntu 24.04. Windows Chromium launch was unavailable. The clean-only prebuilt configuration refused the dirty checkout; the ordinary local configuration ran the original cases unchanged. Browser and cost evidence precede the equivalent predicate extraction and named helper relocation; neither was remeasured after those mechanical changes or the subsequent startup-mock correction.