Repository navigation
fix: warn when running process is stale relative to on-disk install (#327) - #328
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-328Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr328.tgz
npm install -g packageThis comment is automatically updated on each push. |
[bot] PR #327 reviewed — LGTM. I checked out Diff vs. description — matches exactly:
Pre-flight (fresh worktree,
Functional smoke test (stubbed registry fetch, isolated
Edge cases considered:
Nit (non-blocking): the new warning line uses a literal em dash Release decision (§5): my read is this does not require a no-op release first — the rule targets changes to the upgrade mechanism (download/extract/install/version-compare logic), and this is a log-only line in the version-check path that cannot affect the upgrade path's behavior. Shipping directly is safe; a no-op first is also fine if you want the rule applied strictly. Your call. |
What
checkForUpdatereads the version from the on-disk install (diskVersion ?? opts.currentVersion) before comparing with the npm registry. When an auto-update has already replaced the on-disk install but the process was never restarted, every periodic check logs[update] current=0.1.62 latest=0.1.62 (up to date)— misleading, because the running code is still the old version. The one-time "Restart to finish" message at install time is the only signal, and once missed, it is gone forever.This PR makes the up-to-date branch detect that state and log a persistent warning instead:
Why (issue #327)
The reported symptom (context meter jumping 0% → 405% then an EMERGENCY compress) was caused by a stale v0.1.5x process: preflight payload-estimate trigger (v0.1.60) and credit netting (v0.1.56) were not running. Disk already had 0.1.62, so the updater kept saying "up to date" and the user had no way to know a restart was needed. Restarting fixes the symptom; this PR fixes the silence.
Changes
src/update.ts: new exported pure fnstaleInstallStatus(diskVersion, runningVersion) → "restart" | "current"(reuses existing strictisNewer); up-to-date branch ofcheckForUpdatewarns when disk > running.tests/update-restart-reminder.test.ts: 5 unit tests (disk-newer / equal / disk-older / undefined / numeric-vs-lexicographic compare).No control-flow change to the download/extract/install path — log-only in the check path.
Pre-flight
npm run typecheck— cleannpm test— 745/745 pass (740 existing + 5 new)npm run build— successRelease note (§5)
This touches
src/update.ts, so per the no-op-release rule this is flagged for human decision: the change is log-only in the version-check path (no download/extract/install/version-compare behavior change), but a no-op release first is the conservative route if you want the rule applied strictly.