Repository navigation
fix(self-upgrade): restart bridges only when something they loaded changed - #973
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
wp-coding-agents-upgraderestarts 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:Pi process exited mid-turn);From the user's side, that looks like the bot repeatedly stops responding.
Fix
cmd_applyfingerprints each bridge beforeupgrade.shruns, then restarts only the units whose fingerprint changed (or that are new). The fingerprint covers everything a running bridge loaded when it started:EnvironmentFiles;*-configdirectories the unit references (plugins, prompt and channel config), excluding*.bak-*backups;package.jsonof 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.shgets a behavioral case: the real functions run against a fixture unit with a stubbedsystemctl. 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 exactlyroadie.service. On trunk the no-op case restarts, so it fails there.@extrachill/roadie 0.95.0andpi-coding-agent 1.8.0plus/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.