[AI-assisted] fix(update): clear stale plugin refs after failed updates#81512
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Source inspection on current main shows disableOnFailure only disables plugins.entries., and the PR proof/test scenario gives a concrete stale allow/deny/slot config state. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the focused updater cleanup after normal CI, keeping install, package scanning, fallback selection, and uninstall behavior unchanged. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows disableOnFailure only disables plugins.entries., and the PR proof/test scenario gives a concrete stale allow/deny/slot config state. Is this the best way to solve the issue? Yes. Cleaning dependent config inside disablePluginConfigEntry is the narrow maintainable fix and aligns failed-update disablement with the existing uninstall cleanup contract while preserving install records. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 26da4edbe150. |
5373bc2 to
cabef33
Compare
|
Landed via rebase onto main.
Thanks @JARVIS-Glasses! |
Summary
disableOnFailureonly disabledplugins.entries.<id>and could leave staleplugins.allow,plugins.deny, and selected plugin slots pointing at the disabled plugin.memory/contextEngineslots to their defaults while preserving the install record for later repair.Change Type
Scope
Linked Issue/PR
Real behavior proof
updateNpmInstalledPluginsproduction helper with a synthetic local config and no external credentials.{ "changed": true, "entry": { "enabled": false }, "allow": [ "keep" ], "deny": [ "blocked" ], "slots": { "memory": "memory-core", "contextEngine": "legacy" }, "installPreserved": true, "outcome": "skipped" }lossless-clawpackage from v2026.5.12-beta.5 plugin update disables lossless-claw after @beta fallback and leaves stale contextEngine config #81499.disablePluginConfigEntry()only setentries.<id>.enabled = falseand did not touch allow/deny or slots.Root Cause
disableOnFailurewith a plugin selected in policy lists and plugin slots.Regression Test Plan
src/plugins/update.test.tsdisableOnFailureclears stale allow/deny references and resets selected memory/context-engine slots while preserving the install record.User-visible / Behavior Changes
After an external plugin update failure disables a plugin, plugin policy and selected plugin slots are kept consistent with that disabled state. A context-engine plugin disabled during update now leaves the slot reset to
legacyinstead of continuing to point at the disabled plugin.Diagram
Security Impact
Repro + Verification
Environment
demoselected inallow,deny,slots.memory, andslots.contextEngineSteps
tsxproof above.Expected
Actual
entry.enabled=false,allow=["keep"],deny=["blocked"],slots.memory="memory-core",slots.contextEngine="legacy",installPreserved=true, andoutcome="skipped".git diff --checkandoxfmtpassed.Evidence
Human Verification
memory/contextEngineslots while preserving the install record.Review Conversations
Compatibility / Migration
Risks and Mitigations