Skip to content

fix(worker): finish supervisor handover before serving work - #1079

Merged
nixuuu merged 1 commit into
devfrom
fix/linux-worker-remote-gateway-update
Nov 21, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/linux-worker-remote-gateway-update

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 21, 2026

Copy link
Copy Markdown
Member

Problem

During two Linux worker updates, the candidate connected to the gateway and confirmed startup at WorkerLink Welcome. The resident supervisor then requested handover. The candidate started processing the archived-thread snapshot as it was shutting down, waited for cleanup, and rejected the arriving configuration without validation issues. The same binary applied the same configuration on its next start. Desktop Remote uses the Electron updater and a local BFF in this mode.

Change

  • Give the resident supervisor a chance to request handover before the candidate serves WorkerLink, replays the journal, or processes the archived-thread snapshot.
  • Keep local startup confirmation for the rollback watchdog. Report update success through UpdateService once a worker is about to serve the link. Report failures and rollbacks independently of WorkerLink.
  • Use the existing handover IPC with supervisors from earlier releases.

Fixes: #28

Verification

  • The compiled Linux worker regression failed on the original code because the candidate started archived-thread cleanup before handover. It passed with the fix under the previous supervisor. The final worker applied config v10 and started Codex while preserving the pending AVD reservation.
  • 30 integration tests passed through check:tmp across worker update cleanup, shutdown, route migration, and the update service. After rebasing on dev, all 22 update and handover tests passed again against the updated binary build script.
  • Worker, updater, and integration-test typechecks and lint on edited files passed. Full verification is left to GitHub CI. The running systemd service stayed on its installed release.

@nixuuu
nixuuu enabled auto-merge (squash) November 21, 2026 13:58
@nixuuu
nixuuu merged commit 23e3e61 into dev Nov 21, 2026
16 checks passed
@nixuuu
nixuuu deleted the fix/linux-worker-remote-gateway-update branch November 21, 2026 14:07
nixuuu added a commit that referenced this pull request Nov 21, 2026
## Changes

The Updates panel on phone, web and desktop now counts and installs
Canopy updates only. Check, Update all and Retry no longer perform
incidental work on provider CLIs. Agent CLIs keep their own check and
install controls in Settings, including on linked workers.

The gateway retires CLI steps when reading an older saved run. It
rotates the run ID when indices change so an older Retry cannot select a
different target. New clients send distinct bulk action names, which
also prevent an older gateway from starting a mixed update.

Worker reconnects used to start native session probes for every archived
thread. The observed Linux worker took over three minutes to exit after
the executable was staged and another three minutes to hand over after
reconnect. Its final process applied configuration within a second. The
worker now retains completed archive fences across connections and
shares native session inventories across a batch. It still retries
failed cleanup and closes resources belonging to the archived threads.

Fixes: #882

Related: #1079

## Verification

- 30 focused update planner, scheduler and gateway integration tests
passed. Coverage includes historical mixed runs, stale retry indices,
linked computers, explicit CLI installs and older clients.
- 16 focused worker tests passed, including compiled worker handover and
a 66-thread archived snapshot with a failed cleanup and a reconnect.
Gateway and worker typechecks and edited-file lint passed.
- Verified the panel on an isolated Android emulator. A CLI-only failure
left Canopy up to date, mixed failures counted only Canopy, and Settings
sent the explicit CLI calls. An older gateway rejected bulk update
without a fallback install request.
- Chromium at 375 and 1280 px with controlled API responses covered the
indicator, check, mixed historical results, retry and explicit local and
linked CLI actions.
- The running worker was not restarted for verification. The first
upgrade from an older build still uses that build's shutdown code. Full
repository verification runs in CI.

## Copy audit

Removed the sentence promising CLI updates after Canopy updates. The
phone and web compatibility message directs the user to update Canopy on
the gateway. CLI check errors stay with the CLI controls in Settings.
Checked the status and action labels at both browser widths and in the
Android sheet. No outstanding copy findings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant