Skip to content

fix: refresh model catalogs after auth and config changes - #135063

Merged
steipete merged 1 commit into
mainfrom
codex/130706-catalog-stamp-main1138
Sep 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/130706-catalog-stamp-main1138

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

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.list request. 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; one chat.metadata.changed event then permitted one read-only preparedOnly observation, 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 41ff392b26f834045077f7bc3cfec4bd2cedce71 with 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.

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: #130324, #134361.
@steipete
steipete requested a review from a team as a code owner September 1, 2026 09:41
@steipete steipete self-assigned this Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Sep 1, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:45 AM ET / 09:45 UTC.

ClawSweeper review

What this changes

The 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 provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep 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
Reviewed head: f2f90bcfd1979f1c30bacf7c7b5df19a5f194d52

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small owner-boundary repair with a focused regression test and no source-supported finding; normal exact-head CI is still pending.
Proof confidence 🌊 off-meta tidepool Not applicable: The Repository State identifies the author as a MEMBER, so the external-contributor proof gate does not apply; the supplied test claim was treated as supplemental rather than independently executed proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The Repository State identifies the author as a MEMBER, so the external-contributor proof gate does not apply; the supplied test claim was treated as supplemental rather than independently executed proof.
Evidence reviewed 6 items Introduced owner-boundary fix: The publication helper now stamps the snapshot, removes any prior registry entry, and registers the exact returned snapshot; config-only advancement uses that helper instead of replacing the owner snapshot directly.
Caller and stale-read invariant: Config-only updates advance each non-read-only owner, while stale refresh first resolves the owner by the exact snapshot object and only then invokes full catalog discovery.
Catalog-read callee: Only an explicit read with refreshFullCatalog requests stale refresh; ordinary reads retain the existing catalog cache behavior.
Findings None None.
Security None None.

How this fits together

Prepared 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]
Loading

Before merge

  • Complete next step (P2) - No repair job is warranted: this active maintainer-authored PR already contains the narrow source-supported correction; await normal exact-head checks.
Agent review details

Security

None.

PR surface

Source -3, Tests +6. Total +3 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 11 -3
Tests 1 9 3 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 17 14 +3

Review metrics

Metric Value Why it matters
Production versus regression LOC production +8/-11 (net -3); tests +9/-3 (net +6) The repair consolidates existing publication logic while extending the current owner-lifecycle regression rather than adding a parallel path.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This repairs stale model inventory after a bounded auth-plus-config sequence without disabling normal agent operation.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The Repository State identifies the author as a MEMBER, so the external-contributor proof gate does not apply; the supplied test claim was treated as supplemental rather than independently executed proof.

Label justifications:

  • P2: This repairs stale model inventory after a bounded auth-plus-config sequence without disabling normal agent operation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The Repository State identifies the author as a MEMBER, so the external-contributor proof gate does not apply; the supplied test claim was treated as supplemental rather than independently executed proof.

Evidence

What I checked:

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Marvinthebored: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • jalehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 19ecf40 into main Sep 1, 2026
282 checks passed
@steipete
steipete deleted the codex/130706-catalog-stamp-main1138 branch September 1, 2026 12:08
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant