Two more review findings, plus a self-correction.
Stale wentAwayRef (Macroscope): the ref persists for the component's
lifetime, so an outage from before the click satisfied the resolve
predicate on the next render and re-enabled the button mid-update,
allowing a second dispatch. Reset both refs when an attempt is armed so
only outages during that attempt count.
Unrelated outage shown as a restart (Bugbot): making the window
write-once-and-expire last round traded one bug for another — any
disconnect within 90s was dressed up as an intentional restart. The
window now ends once the environment has gone away and come back, i.e.
the restart it was armed for has been seen through. That is the narrow
version of what an earlier revision got wrong by ending it on any healthy
connection; the difference is requiring the disconnect first.
The observation is used only for the banner. The update action's release
path stays independent of it — coupling those is what produced the
earlier family of bugs where each consumer invalidated the other's
evidence.
Also removed a test committed in the previous change that passed with and
without its fix, so it verified nothing.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Cursor found three defects (one High) that shared a root cause: the
restart window had been given a second job — releasing the update
action — while the window itself deleted the evidence that job depended
on. Patching each symptom would have kept the coupling, so sawDisconnect
is gone.
The window is now write-once-and-expire. It is armed while the old
server is still connected, so nothing observed on the connection can
reliably end it early; presentation gates on the environment actually
being unavailable, which makes a window outliving its restart inert.
That removes both "a brief blip during install poisons the flag" and
"reconnecting clears the flag before the action can read it".
Releasing the action is now its own signal, independent of the window,
with the two shapes a rejected restart can take:
- the environment went away and came back, so something restarted but
did not deliver the new version; or
- the window lapsed with the connection never dropping, so no restart
ever happened (systemd refused it and rolled back).
The second is the High-severity case: previously nothing set the flag,
so the action stayed disabled for the full 12-minute window.
The decision is a pure exported predicate because the component harness
stubs useEffect. Verified by removing the lapsed-window branch, which
fails exactly the test covering that case.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
An independent gpt-5.6-sol review found that the restart overlay never
actually engaged in the normal flow — the feature was inert.
ChatView cleared the expectation on any render where the connection was
"connected". But the window is armed while the old server is still
connected (that is the point: the acknowledgement races its own
disconnect), so the store update triggered a render that destroyed the
window within milliseconds, long before the server went away. Both
re-arm points had the same problem. The user therefore still got the
outage banner and escalating backoff.
The window now tracks whether the restart's disconnect was actually
observed. A connected environment only ends the window once that has
happened; before it, "connected" just means the restart has not started
yet. Re-arming preserves an already-observed disconnect.
Also fixes the follow-on the same review found: because a rejected
restart can no longer be reported through the acknowledged RPC, the
update action could stay disabled for the full 12-minute safety window
with the mismatch unresolved. A settled restart window (disconnect seen,
window closed) now releases it so the user can retry immediately.
The restarting/settled decisions are pure exported predicates, since the
component test harness stubs useEffect and cannot exercise
effect-driven behavior. Both are tested, and both tests were confirmed
to fail against the old logic.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Three defects found by Macroscope and Cursor Bugbot:
- The restart window was armed only at click time, but an npm install can
consume most of the 10-minute request window, so a slow-but-successful
update restarted after the window had lapsed and was presented as an
outage. Re-arm from the acknowledgement and from the interrupt path,
matching what keepPendingForRestart already does for the button expiry.
- Effect.catch on the detached restart fiber only sees typed failures, so
an unexpected defect skipped the inFlight reset and left a live process
refusing every further update until restarted by other means. Release
the guard from Effect.onExit, outside the typed handler. Success still
deliberately keeps it set: systemd is about to stop the process and a
second update would race the handoff.
- "A server update is already in progress" is a typed failure, so it
cleared a restart overlay that the earlier still-pending update needed,
restoring the harsh reconnect UI mid-restart. That reason now lives in
contracts as SERVER_SELF_UPDATE_ALREADY_RUNNING_REASON with an
isAlreadyRunning helper, so the client can distinguish it structurally
instead of matching prose.
Each fix has a regression test; the defect-path test was confirmed to
fail without the onExit change.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Clicking "Update server" on a relay-connected server showed a spinner,
then a disconnected banner with a raw transport error, then hung until
the page was refreshed. Three separate causes:
1. The boot-service (systemd) update path ran `systemctl --user restart`
synchronously inside the RPC handler, so the process died before the
acknowledgement flushed. Every successful update reached the client as
an interrupt, which ServerUpdateAction released quietly — no success
toast, and nothing told the connection layer a restart was coming.
The restart is now deferred like the respawn path. Rollback and the
in-flight reset move onto the detached fiber and log instead of
failing the (already-acknowledged) RPC.
2. Reconnect backoff escalates to 16s, so the client was frequently
asleep exactly when the server came back; refreshing reset the
failure count, which is why refreshing "fixed" it. A restart-expected
overlay is now armed before dispatch and retries on a flat 2s cadence
while it is active, and only while the supervisor is sleeping in
backoff so a live attempt is never interrupted. It expires on its own
after 90s and is withdrawn on an explicit RPC failure, which proves
the server stayed up.
3. Two consecutive websocket-ticket failures evicted the cached DPoP
token, forcing a full relay bootstrap and token exchange during
reconnect. Eviction is now limited to failures suggesting a stale
endpoint; plain unreachability (network/timeout) — the shape of a
restart — keeps the token.
Also stops piping raw transport messages (which embed internal endpoint
URLs) into the composer banner: presentation maps each failure reason to
a stable summary and carries the reason for callers, while the raw
message remains on the supervisor state for diagnostics.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
- Restore light-mode glass, dialog, dropdown, and composer colors
- Refine provider wizard, changed-file cards, sidebar controls, and buttons
- Update wizard step tests for the new list structure