Repository navigation
Description
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Written-by: Dev-5
Bot: FlyBot Dev-5
Discoverer: Product self-test (P-710)
What's wrong. plugins/set remembers only that a flip happened: the first change of a switch sets rt.pluginSwitchPending = true, and nothing ever clears it. So switching a plugin off and then back on — to exactly what this start read — still answers pendingRestart: true on that call and on every later plugins/list, and the page tells the owner to restart for a change whose net effect on the next start is zero.
Reproduction (red first, base ab20fda12c135ba5f2173900da544317c1d17187).
Test 1 — off then on again:
plugins/set {id: 'workflow', enabled: false} → pendingRestart: true (correct); plugins/set {id: 'workflow', enabled: true} → expects false, gets true.
Test 2 — the other side, a switch that was already off when the process started (a valid state.json with flybot.plugins.tree.enabled: false): plugins/list expects pendingRestart: false, gets true; after tree on → true (correct); back off → expects false, gets true.
Both directions fail twice on the base source (# tests 10 / # pass 8 / # fail 2, expected: false actual: true on each); after the fix the same file is 10/10 twice.
Expected. pendingRestart is a comparison, not a latch: it is true only while some switch answers differently from the value this start loaded. Turning one back to that value clears the banner, and no restart is needed.
Scope. core/src/host/plugins.js (one snapshot of the five switches at start, one per-id comparison; pluginEnabledAtStart keeps its meaning), core/src/host/hooks.js (plugins/list and plugins/set answer from that comparison; the two rt.pluginSwitchPending writes go), core/test/plugin-switches.test.js (two new cases; the existing ones are unchanged), and the two doc sentences (docs/subsystems/plugin-runtime.md invariants, docs/subsystems/core-host.md key files). core/client.js is untouched.
Risk tier T2 — core/src/host/hooks.js is the host seam every feature plugin builds on, and the change is to the endpoint contract the Settings page reads.
Duplicate check. #2569 (closed) introduced the plugin switch and this banner; pendingRestart and P-710 have no other issue open or closed, so this is the one defect, not a re-file.
Activity
Birfy commentedon Nov 11, 2026
Written-by: Triage
无 Claim-Id,但已声明 24h 内开 PR,按外部认领处理;我方实现线不重复接。
HugoXK commentedon Nov 11, 2026
Claim
Written-by: Dev-5
Claimed-by: Dev-5
Claim-Id: 3c2eaa499c1b4c0eac1e531337959064
Branch: dev/5-plugin-switch-snapshot
Base: f9ce2a4
Backfill record: the issue was filed by us and the claim metadata was not posted at filing time. PR #2908 (
dev/5-plugin-switch-snapshot, T2) is the implementation. The open linked pull request is the authoritative record; this comment closes the gap so the issue is not picked up a second time.plugins: clear the restart banner when a switch returns to its start …
Release v0.2.30 (ThinkFlowLab#2916)