Repository navigation
fix(plugins): recover plugin catalog after transient startup failure - #126815
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 3:29 PM ET / 19:29 UTC. ClawSweeper reviewWhat this changesThe PR replaces the plugin catalog’s bespoke cached promise with the shared lifecycle-aware loader so a failed catalog initialization can be retried. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessNo patch correctness defect found. Keep this protected maintainer PR open until exact-head checks finish and any latest ClawSweeper rank-up moves are addressed or explicitly skipped. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGateway startup prewarms plugin-management data, while Gateway plugin APIs later use the same catalog for inventory, icons, and installation choices. The catalog result is process-stable until the plugin-metadata lifecycle owner clears it. flowchart LR
A[Gateway startup] --> B[Plugin catalog prewarm]
B --> C[Lifecycle-aware catalog loader]
C --> D{Catalog load outcome}
D -->|success or fallback| E[Process-stable catalog]
D -->|rejected load| F[Remove failed generation]
E --> G[Inventory icons and installs]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -11, Tests +69. Total +58 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the lifecycle-owned implementation once exact-head CI is green; it preserves fallback policy and removes the duplicate rejected-promise cache. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main retains a rejected catalog promise at src/plugins/management-service.ts:257 and reuses it at :400; the focused management-service regression models the failed-load then retry path. Is this the best way to solve the issue? Yes. Reusing the lifecycle-owned loader is better than maintaining a second cache because it already provides coalescing, lifecycle clearing, and generation-safe rejection eviction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c7322d761a73. LabelsLabel changes:
Label 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
|
|
Merged via squash.
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(plugins): recover plugin catalog after transient startup failure This is item 2/3 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
What Problem This Solves
Fixes an issue where a transient official-plugin-catalog initialization failure during Gateway startup permanently broke subsequent plugin inventory, icon, and installation requests until the process restarted or an operator explicitly refreshed plugin metadata.
Why This Change Was Made
The plugin management owner maintained a bespoke process-wide cached Promise that never evicted rejected loads, so startup prewarming poisoned every later caller. Replace that duplicate cache and its hand-registered lifecycle hook with the existing canonical lifecycle-owned Promise loader, which already coalesces successful loads, evicts only the exact rejected generation, and participates in explicit plugin-metadata resets. Hosted catalog validation, signed-feed trust, fallback policy, plugin configuration, public SDK contracts, and persistent state are unchanged.
User Impact
Plugin lists, icons, and installations recover on their next request after a transient catalog bootstrap failure. Successful hosted and bundled-fallback catalog results remain process-stable, concurrent loads stay coalesced, and a stale rejected request cannot invalidate a newer lifecycle generation.
Evidence
listManagedPluginsrequest rejected with the firsttransient catalog bootstraperror instead of invoking the catalog loader again; the remaining three owner cases passed.OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_FS_MODULE_CACHE=0 node scripts/run-vitest.mjs src/plugins/management-service.lifecycle-cache.test.ts src/plugins/management-service.test.ts src/plugins/plugin-cache-primitives.test.ts --configLoader runner— 45 tests passed across management, lifecycle, installation-facing behavior, and the shared cache primitive.