Repository navigation
fix(plugins): surface swallowed cleanup, setup, and CLI-load failures - #124570
Conversation
Three silent-failure sinks in the plugin lifecycle, all violating
'every action ends in a visible outcome or a recorded reason':
- cleanupReplacedPluginHostRegistry collects per-hook cleanup failures
instead of throwing (it must finish every plugin), but both callers
discarded the returned failures array entirely — broken session-
extension/scheduler teardown vanished. The shared funnel now warns
per failure with plugin and hook ids.
- setup-registry dropped broken setup entries with catch{return null}
and threw-away registration errors with catch{return false}, silently
removing a plugin's providers/CLI backends/migrations from
onboarding. Both now push typed diagnostics (setup-entry-load-failed,
setup-registration-failed) — and since the diagnostics array had no
operator surface at all, the registry build now warns once per
uncached build for every diagnostic (including the previously
invisible descriptor-drift ones).
- loadPluginCliDescriptors swallowed total load failures behind a muted
per-plugin logger; a failure removes every plugin command from
help/dispatch and must not vanish with it. One warn on the catch.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 16, 2026, 8:43 AM ET / 12:43 UTC. ClawSweeper reviewWhat this changesThe PR adds warnings and typed diagnostics when plugin cleanup, setup registration, or CLI descriptor loading fails. Merge readinessKeep open: the patch improves three silent-failure paths, but its new setup-entry loader diagnostic still disappears on the one-shot provider and CLI-backend resolution paths. Priority: P2 Review scores
Verification
How this fits togetherPlugin metadata feeds setup/onboarding, runtime registry replacement, and CLI command discovery. Those paths must preserve their current fallback behavior while making failures visible to operators. flowchart LR
A[Plugin manifests] --> B[Setup registry]
A --> C[CLI descriptor loader]
D[Registry replacement] --> E[Cleanup hooks]
B --> F[Provider and backend lookup]
B --> G[Onboarding]
C --> H[CLI help and dispatch]
E --> I[Operator logs]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +52, Tests +21. Total +73 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Route setup-module load failures through one shared reporting callback so full-registry and one-shot provider/backend lookups all emit the same operator-visible failure, with focused regression coverage. Do we have a high-confidence way to reproduce the issue? Yes, from source: make the setup module loader throw during one-shot provider or CLI-backend resolution; the new catch returns undefined without a diagnostic sink or warning. Is this the best way to solve the issue? No: the shared loader catch is the right owner, but its optional diagnostics sink leaves the two one-shot callers outside the reported failure path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 751160109270. 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.
|
…openclaw#124570) Three silent-failure sinks in the plugin lifecycle, all violating 'every action ends in a visible outcome or a recorded reason': - cleanupReplacedPluginHostRegistry collects per-hook cleanup failures instead of throwing (it must finish every plugin), but both callers discarded the returned failures array entirely — broken session- extension/scheduler teardown vanished. The shared funnel now warns per failure with plugin and hook ids. - setup-registry dropped broken setup entries with catch{return null} and threw-away registration errors with catch{return false}, silently removing a plugin's providers/CLI backends/migrations from onboarding. Both now push typed diagnostics (setup-entry-load-failed, setup-registration-failed) — and since the diagnostics array had no operator surface at all, the registry build now warns once per uncached build for every diagnostic (including the previously invisible descriptor-drift ones). - loadPluginCliDescriptors swallowed total load failures behind a muted per-plugin logger; a failure removes every plugin command from help/dispatch and must not vanish with it. One warn on the catch.
What Problem This Solves
Three silent-failure sinks in the plugin lifecycle, all violating the repo's core doctrine that every action ends in a visible outcome or a recorded reason:
cleanupReplacedPluginHostRegistrydeliberately collects per-hook cleanup failures instead of throwing (it must finish every plugin) — but both call sites inruntime.tsdiscarded the returnedfailuresarray entirely. A plugin whose session-extension/scheduler teardown broke during disable/reload left zero trace.setup-registrydropped broken setup entries (catch { return null; }) and threw-away registration errors (catch { return false; }), silently removing a plugin's providers/CLI backends/config migrations from onboarding. Worse: the module'sdiagnosticsarray — including the existing descriptor-drift diagnostics from feat(plugins): warn on ignored setup runtime #71253 — had no operator surface at all; it was only ever read by tests.loadPluginCliDescriptorsswallowed total load failures behind an intentionally muted per-plugin logger; a failure removes every plugin command from help/dispatch and vanished with it.Why This Change Was Made
cleanupPreviousPluginHostRegistry) now warns per failure with plugin + hook ids — one fix at the shared funnel covers both discard sites, using the exact pattern the rollback path already uses.setup-entry-load-failed,setup-registration-failed), and the registry build warns once per uncached build for every diagnostic — giving the whole channel (new + pre-existing drift codes) its first operator surface. The two one-shot resolvers log directly.User Impact
Operators debugging "my plugin's commands/providers disappeared" or "plugin teardown left stale state" now get warn-level log lines naming the plugin and the reason, instead of silence.
Evidence
records a diagnostic when the setup entry fails to loadfails pre-fix (stash proof); the atomic-publish test'sdiagnostics: []assertion updated to expect the recordedsetup-registration-failed(it was pinning the silent drop).node scripts/run-vitest.mjs run src/plugins/setup-registry.test.ts src/plugins/setup-registry.runtime.test.ts src/plugins/setup-registry.migrations.test.ts src/plugins/cli.test.ts src/plugins/runtime.test.ts— all green.