Skip to content

v0.24.0 — a bridge follows the version its server asks for

Choose a tag to compare

@jfbauer jfbauer released this 03 Oct 17:15
99be342

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:

  1. 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.
  2. It waits until nothing is in progress: no turn, upload, file transfer or app call.
  3. It pins AI_BRIDGE_VERSION in 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=always or on-failure, an ExecStart that runs @tetrixdev/ai-bridge@${AI_BRIDGE_VERSION}, and exactly one writable env file setting AI_BRIDGE_VERSION. The bridge finds all of this by asking systemd about its own unit; AI_BRIDGE_ENV_FILE overrides 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-update or AI_BRIDGE_SELF_UPDATE=0.
  • ai-bridge install writes the pinned form on Linux. It also takes --allow-native, --local-tools and --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).