Repository navigation
fix(models): model browsing fails after automatic plugin activation - #130481
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 7:40 PM ET / 23:40 UTC. ClawSweeper reviewWhat this changesThe PR transfers the Gateway-owned plugin-metadata snapshot into model-catalog worker threads so model browsing and authentication refresh retain the active plugin generation. Merge readiness✅ Ready for maintainer review Keep open. The resolved changelog finding is no longer in the PR, and the exact worker-boundary repair is coherent; current-head CI remains the normal landing gate. Likely related people: steipete (high) and joshavant (medium). Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherThe Gateway prepares model-catalog workers from lifecycle-owned plugin metadata. Those workers perform model and authentication discovery for model-browsing RPCs. flowchart LR
A[Gateway startup] --> B[Plugin metadata snapshot]
B --> C[Prepared catalog request]
C --> D[Worker thread]
D --> E[Model and auth discovery]
E --> F[Model browsing RPC]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +25, Tests +55. Total +80 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Land the snapshot handoff after the exact-head checks pass, while keeping the separate recovery behavior tracked by #126108 and #126224. Do we have a high-confidence way to reproduce the issue? Yes — source inspection shows current main reconstructs worker metadata from agent inputs rather than receiving the published Gateway snapshot, and the PR adds focused scope-mismatch regressions. Is this the best way to solve the issue? Yes — transferring the immutable owner graph and restoring only its process-local normalizer preserves the existing generation check without adding retries, configuration, or provider-specific policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 02a60e0d8714. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer review completed for ca1e79e.
Exact-head CI is complete and successful: https://github.com/openclaw/openclaw/actions/runs/33022280478 . The previously documented baseline-only metadata-context assertion remains a named follow-up; it was not weakened. No production code changed after the reviewed and CI-verified head. |
|
Follow-up to the maintainer disposition above: the native landing gate enforces release-only ownership of the root changelog even for normal maintainer fix PRs. The changelog edit has therefore been removed, addressing the P3 / Rank-up request; the release-note context remains in this PR body. The prior decision to retain that entry is superseded. No bypass flag was used, and the production/test patch is unchanged. The original source head passed full CI at https://github.com/openclaw/openclaw/actions/runs/33022280478 . The updated head will be revalidated before landing. |
|
Final-head CI is green: run 33023800497, attempt 2, head Attempt 1 had one unrelated failure in the 50-worker reconciliation stress test newly added to main by #130449. That file is absent from this PR head. I inspected the failure and performed one targeted unchanged-shard rerun, which passed; no assertions, concurrency, or timeout were weakened. Investigation also reproduced an independent subprocess hard-deadline output-loss bug, recorded with a runnable probe in #130504. The causal connection to the CI empty-SHA error remains unproven. The release-owned changelog cleanup is complete. Production and tests remain byte-identical to the source head that passed the first full CI run. Real Gateway proof, owner-boundary regressions, build, local changed gates, and independent Codex autoreview are recorded in the PR body. No persisted-state/schema change is present; the automatic data-model warning is inapplicable. Separate plugin-change recovery remains open in #126108/#126224. |
|
Merged via squash.
|
* fix(models): model browsing fails after automatic plugin activation (openclaw#130481) * fix(models): preserve Gateway metadata in catalog workers * docs: leave catalog release notes to release automation * Gate catalog worker metadata backport --------- Co-authored-by: Peter Steinberger <[email protected]>
…penclaw#130481) * fix(models): preserve Gateway metadata in catalog workers * docs: leave catalog release notes to release automation
What Problem This Solves
Fixes an issue where users browsing models or refreshing model authentication receive
prepared model catalog worker reconstructed a different runtime generationon an otherwise healthy Gateway. A fresh multi-agent Gateway with automatic provider activation reproduces this without changing any plugin files.Why This Change Was Made
The Gateway publishes one lifecycle-owned plugin metadata snapshot, but the catalog worker discarded it and rediscovered metadata using an individual agent's workspace and runtime activation config. Those inputs need not match the source metadata's workspace or policy. Passing only the original workspace fixed four regression cases but still failed the real Gateway's activation-overlay case.
Transfer the exact metadata graph, including the paired inventory, manifests, scope, and owner maps. The plugin metadata owner restores its process-local ID normalizer and immutability; ordinary metadata loads share that finalization path. Keep the existing generation fingerprint and parent-lifetime checks. No consumer retries, new config, storage changes, or provider-specific branches.
Production LOC: +30/-5 (net +25). The growth implements the missing worker ownership handoff and restores non-cloneable behavior; copying only inventory or weakening identity checks would lose the paired metadata contract. Tests: +75/-20 (includes reindent of an existing table-driven test). Release-note context is in this body; the root changelog remains release-owned.
Provenance: likely made visible by #125596, authored and merged by @steipete on 2026-08-18 (
fd216cb5509e), which made Gateway metadata explicitly shared across prepared agent owners. The worker's independent reconstruction predates that change.Related: #126108 and #126224. The latter is assigned to @jalehman and addresses recovery after plugin changes. This fixes the initial unchanged-plugin metadata handoff, not that recovery contract; neither item is closed by this PR. Metadata identity is not executable-byte pinning: the first worker still imports the selected plugin paths, and replacing plugin code before that import is not claimed fixed here.
User Impact
Model browsing and auth refresh use the Gateway's published plugin metadata even when agents have separate workspaces or startup enables a provider in memory. Existing session/agent/global model-selection behavior remains intact.
Evidence
UNAVAILABLEfrommodels.listwithview: "all".sessions.patch, then verified persisted config after shutdown: session, agent, global, default-main, and default-overridden-agent scopes. No provider inference or external credentials were used; this is real Gateway/CLI/RPC and persistence proof, not authenticated provider proof.check:changedpasses, including core production/test typechecks, changed-file lint, formatting, import-cycle, dead-export, plugin-boundary, and storage guards. The first remote changed-gate attempt failed during Testbox file sync and stopped its lease; it did not produce a passing check result.ccadcbb749b8d6045ebb2f5b22dab7dccf214496, includingopenclaw/ci-gate. Attempt 1 had one failure in the unrelated 50-worker retention test newly added to main by fix(workers): protect in-flight workspace manifests from concurrent retention #130449; that test is absent from this PR head. One targeted unchanged-shard rerun passed; no assertions, concurrency, or timeout were weakened. The earlier source head also passed full CI 33022280478 before the changelog-only removal.prepared-model-runtime.plugin-context.test.ts's no-current-metadata-probe assertion fails identically on untouched maind27b0e96204aand this patch (one bundled-channel metadata lookup). The remaining nine tests in that owner group pass. A clean independently installed/built baseline reproduced the failure; the assertion was not weakened. Cold broad-suite startup also stalled on both revisions; the real-worker and metadata-owner suites above completed separately. These are not reported as green full-suite proof.