v0.24.0 — a bridge follows the version its server asks for
Self-update. A server can name the bridge version every machine should run, as desired_bridge_version in its welcome. A bridge running as a systemd service that can restart it onto a pinned version follows it by itself, upgrade or downgrade:
- It fetches the version and runs it once with
--version. If that fails, it stays on what it runs and retries after 5 min, doubling, up to 6 h. - It waits until nothing is in progress: no turn, upload, file transfer or app call.
- It pins
AI_BRIDGE_VERSIONin its env file, disconnects cleanly, and exits with code 75. systemd starts the new version.
It says whether it will follow as hello.self_update.
- Only acts on a unit that will pick the pin up. That means
Restart=alwaysoron-failure, anExecStartthat runs@tetrixdev/ai-bridge@${AI_BRIDGE_VERSION}, and exactly one writable env file settingAI_BRIDGE_VERSION. The bridge finds all of this by asking systemd about its own unit;AI_BRIDGE_ENV_FILEoverrides the file. Anywhere else — a terminal, an unpinned unit, macOS, Windows — it only logs. - Strict semver only. No ranges, tags, URLs or commands. Never below 0.24.0.
- Loop protection. A restart that comes back on the old version backs off: 5 min, doubling, up to 24 h.
- Opt-out.
--no-self-updateorAI_BRIDGE_SELF_UPDATE=0. ai-bridge installwrites the pinned form on Linux. It also takes--allow-native,--local-toolsand--no-self-update.
Not covered: a new version that crashes before it runs this code (the --version run makes that rare), and macOS / Windows, where you update by reinstalling with the version you want.
Moving a 0.23.x machine onto it, once. In a pinned unit's env file, set AI_BRIDGE_VERSION=0.24.0 and restart the unit. For an ai-bridge install service, run npx -y @tetrixdev/ai-bridge@0.24.0 install … again with its server and token. See README, "Following the server's version".
Additive, no protocol bump. The server side is laravel-ai-bridge 0.16.0 (AI_BRIDGE_DESIRED_VERSION).