Skip to content

v0.24.1 — self-update fetches one at a time, and repairs a half-installed npx cache

Choose a tag to compare

@jfbauer jfbauer released this 03 Oct 17:39
cb5fdf2

Found while testing 0.24.0 end to end, minutes after it was released. Two npx installs of the same version ran at once on one machine and left half a package in npx's shared cache. Every later run of that version failed with ERR_MODULE_NOT_FOUND.

That was safe, because nothing restarts onto a version that fails its --version run, but the bridge stayed stuck. Several bridges on one machine told to update at the same moment is exactly that overlap.

  • One fetch at a time per machine. The lock lives in ~/.cache/ai-bridge/, and only its holder releases it. A bridge waits up to 5 minutes for its turn; a lock older than 10 minutes counts as stale.
  • Repair. When the --version run fails with a missing module inside an npx cache directory that holds the target version, that directory is removed and the fetch tried once more. A directory holding any other version is never touched.
  • The fetch never throws. A lock or removal failure comes back as a failed fetch, and the updater retries it with the usual backoff.

0.24.0 bridges self-update to this as soon as a server asks for it.