Repository navigation
fix: refresh model catalogs after auth and config changes - #135063
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:45 AM ET / 09:45 UTC. ClawSweeper reviewWhat this changesThe PR centralizes prepared model-runtime config stamping and owner-registry publication so stale catalog reads can refresh after an auth change followed by a config-only update. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep this active maintainer-authored PR open. Its focused registry fix addresses a real snapshot-identity gap not present in fetched current main, and the reviewed diff introduces no correctness finding; exact-head checks remain pending. Priority: P2 Review scores
Verification
How this fits togetherPrepared model-runtime owners publish immutable per-agent snapshots containing static catalog and auth facts. Auth/config updates replace or restamp those snapshots, and explicit model-list reads use the owner registry to refresh marked-stale catalog content without affecting normal turn admission. flowchart LR
A[Auth profile change] --> C[Prepared runtime owner]
B[Config-only update] --> C
C --> D[Stamp and publish snapshot]
D --> E[Owner snapshot registry]
E --> F[Explicit model-list read]
F --> G[Stale catalog refresh]
G --> H[Updated model inventory]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -3, Tests +6. Total +3 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep snapshot stamping and WeakMap registration in the one publication helper, then land after exact-head CI confirms the focused lifecycle regression. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence: before this patch, config advancement created a new stamped snapshot without registering that object, so the subsequent stale-refresh lookup could not find its owner. No target code was executed in this read-only review. Is this the best way to solve the issue? Yes. The publication helper is the correct owner boundary because it is where immutable snapshot replacement and registry identity must remain atomic across config-only, ordinary, and batch publication. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f2646be7a983. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash merge.
|
…5063) Publish config-stamped snapshots through the existing owner registry for config-only updates as well as ordinary and batch builds. Existing leases stay immutable and retain their auth bindings. Extend the stale-catalog regression; all 65 related tests pass. Related: openclaw#130324, openclaw#134361.
Related: #130324. Follow-up to #134361; preserves the config-stamp behavior from #128608 and scoped refresh from #129257.
What Problem This Solves
Fixes an issue where users opening the model list after a credential change and an unrelated config edit could keep seeing stale model inventory until the Gateway restarted.
Why This Change Was Made
Config-only updates replaced the prepared snapshot without updating the lookup used for an explicit stale-catalog read. Stamping and registering a snapshot now happen together in the existing publication helper, shared by ordinary, batch, and config-only publication. Existing readers retain their immutable snapshot and auth bindings; no catalog rebuild is added to config-only updates.
Production LOC: +8/-11 (net -3). Tests: +9/-3 (net +6), extending an existing regression test. No new config, schema, protocol, dependency, or compatibility path.
User Impact
Model-list reads can refresh stale inventory after unrelated settings changes without restarting the Gateway. Ordinary request paths still avoid eager catalog discovery.
Evidence
The extended existing regression failed before the fix at the missing discovered catalog entries. After the fix, 65 tests across five files passed, covering auth invalidation, config stamps, concurrent stale reads, retained auth bindings, scoped refresh, and owner publication. Formatting passed; independent Codex review found no accepted/actionable P0 issue.
A separate synthetic Linux Gateway test exercised the real public WebSocket sequence in one process: establish discovered inventory, remove one synthetic auth profile while retaining another, observe the static catalog, apply a logging-only config change, and issue exactly one ordinary
models.listrequest. Before the fix, the model stayed static through the unchanged 30-second test deadline. With the exact PR production files, the ordinary request returned its expected prepared fallback at 754ms; onechat.metadata.changedevent then permitted one read-onlypreparedOnlyobservation, which returned the discovered model name and 8192-token context window. The after case passed in 21.21 seconds and Gateway shutdown completed in 75ms. No post-logout forced refresh or restart was used.The public-flow test ran against
41ff392b26f834045077f7bc3cfec4bd2cedce71with its newer catalog worker. The two PR files matched the published head byte for byte; the before and after fixtures, native runner, limits, source guards, and hook configuration stayed fixed. Canonical build prerequisites completed. Temporary Gateway proof code is not added to the PR. This is synthetic Gateway/WebSocket proof, not an authenticated external-provider test or proof that the broader CPU incident is resolved.Exact-head CI completed successfully at
f2f90bcfd1979f1c30bacf7c7b5df19a5f194d52. The ClawSweeper review has no actionable finding; its remaining exact-head CI step is satisfied. A broader local check was previously stopped under host contention after its early guards and is not counted as a complete pass.