Skip to content

fix(self-upgrade): restart bridges only when something they loaded changed - #973

Merged
chubes4 merged 1 commit into
mainfrom
fix/upgrade-restart-only-on-change
Dec 5, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/upgrade-restart-only-on-change

Conversation

@chubes4

@chubes4 chubes4 commented Dec 5, 2026

Copy link
Copy Markdown
Member

Problem

wp-coding-agents-upgrade restarts every Roadie unit for the site at the end of every run, even when the upgrade changed nothing the bot uses. On the Extra Chill VPS, a wp-coding-agents merge triggers a self-upgrade, so on 2026-12-05 Roadie restarted 21 times. Every restart:

  • kills in-flight turns in every active thread (Pi process exited mid-turn);
  • takes the bot offline while it reboots and rehydrates sessions;
  • on a host that is already swapping, adds a heavy cold start.

From the user's side, that looks like the bot repeatedly stops responding.

Fix

cmd_apply fingerprints each bridge before upgrade.sh runs, then restarts only the units whose fingerprint changed (or that are new). The fingerprint covers everything a running bridge loaded when it started:

  • the unit file and its EnvironmentFiles;
  • every file under the *-config directories the unit references (plugins, prompt and channel config), excluding *.bak-* backups;
  • the package.json of each runtime binary the unit names (Roadie, Pi), so a version bump restarts the bot.

Changes that require a restart still get one. #922 still covers making those restarts wait for idle sessions.

Verification

  • tests/self-upgrade.sh gets a behavioral case: the real functions run against a fixture unit with a stubbed systemctl. A no-op upgrade and a backup-only change do not restart; a new Roadie package, a changed config file and a changed unit file each restart exactly roadie.service. On trunk the no-op case restarts, so it fails there.
  • On the production unit, the fingerprint resolves to @extrachill/roadie 0.95.0 and pi-coding-agent 1.8.0 plus /opt/roadie-config, and it is identical across repeated runs.

AI disclosure: Claude (Anthropic) in the Pi coding agent, via a Roadie session at the maintainer's direction, wrote this.

@chubes4
chubes4 merged commit 54e39fe into main Dec 5, 2026
93 checks passed
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