Skip to content

Update Lantern by itself on macOS, announce releases elsewhere - #29

Merged
gitsad merged 14 commits into
mainfrom
feat/auto-update
Nov 10, 2026
Merged

gitsad merged 14 commits into
mainfrom
feat/auto-update

Conversation

@gitsad

@gitsad gitsad commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

What this changes

An installed Lantern now finds a newer GitHub release by itself. On a Mac it uses Electron's autoUpdater with update.electronjs.org, downloads in the background and installs only when nothing would be ended; elsewhere it shows "Lantern X is available" with a button to the release page. There is a Check for Updates… menu item and an Updates setting, "Check for updates automatically" (on by default), and docs/updates.md says what each check sends and how to turn it off.

The Mac feed does not work yet, and it is not fixable in this PR. update.electronjs.org/MobileReality/lantern/darwin-arm64/0.2.2 answers 404 ("needs asset matching .-(mac|darwin|osx)..zip"). The service classifies an asset by name, and Lantern-mac.zip has no -arm64, so it is filed under darwin-x64 (darwin-x64/0.2.2 answers 200 with the v0.3.0 asset, darwin-x64/0.3.0 answers 204). The service needs the asset to be named Lantern-mac-arm64.zip (or Lantern-darwin-arm64.zip). The release workflow was not touched; until the asset is renamed the Mac path is a quiet no-op: one warning in Diagnostics, and Check for Updates points to the release page.

Key files

  • src/main/updater/guard.ts — canInstallNow(state): false for a live session (anything not finished, so unknown counts), a run started by Lantern, an editor terminal, a process below Lantern, or activity that cannot be read.
  • src/main/updater/service.ts — check on start and every 4 h, download, guard polling, postpone, confirmed Restart now; every request goes through the injected fetch and nothing is requested with the setting off.
  • src/main/updater/process-activity.ts — terminals and running commands below Lantern, from the existing process-table helpers.
  • src/main/updater/feed.ts, version.ts — 204/200/404 handling, the latest-release reader with no token, a small semver comparison.
  • src/main/updater/controller.ts, dialogs.ts, native.ts — the menu check and its result texts, the update IPC, the Squirrel adapter.
  • src/main/main.ts, src/main/app-menu.ts, src/renderer/features/update-notice.ts — wiring, the menu item, the in-window notice.
  • src/shared/session-liveness.ts — the one definition of a live session, now shared with the idle tabs.

Before / after

Before: a new release was found and installed by hand. After: a packaged Mac that has a download in the feed reads
Update ready: restart when your sessions finish while any session, run, terminal or editor process is alive, installs by itself when none is (unless "Not now" was pressed), and "Restart now" with something alive first lists what would be lost ("Restarting ends 1 AI assistant session and 2 editor terminals") and restarts only after a confirmation.

Verified with pnpm run typecheck, pnpm run lint, pnpm test, all green, and the real service: darwin-arm64/0.2.2 404, darwin-arm64/0.3.0 404, darwin-x64/0.2.2 200, darwin-x64/0.3.0 204. The update flow itself (a download, quitAndInstall next to the async before-quit handler) was never run. Unreviewed fixes: 0ea2bf5 (reset the install state when Squirrel reports a failure, bound the feed body read, skip the process listing while postponed). Decisions the brief left open: with the setting off, Check for Updates makes no request and says so; a manual check that fails shows a plain information message, not an error dialog. Lantern: 34 files re-mapped.

Run cost

agent model effort calls cache-read cache-write+input
lantern-delegate-high sonnet 5.5 high 157 52430772 866250
└ reviewer ×1 opus 5.5 medium 23 2170007 114220
total 180 54600779 980470

@gitsad
gitsad merged commit e67e8b6 into main Nov 10, 2026
16 checks passed
@gitsad
gitsad deleted the feat/auto-update branch November 10, 2026 17:44
@gitsad gitsad mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant