Commit bbf52b6
feat(agents-desktop): wire electron-updater for update notifications (#4441)
## Summary
Phase 1 of desktop autoupdate — integrates
[`electron-updater`](https://www.electron.build/auto-update) so users
can be notified about new releases. Designed to be the first half of a
two-phase rollout:
- **Phase 1 (this PR):** notification + update download on
Windows/Linux; notify-only on macOS (no auto-install).
- **Phase 2 (follow-up):** Developer ID signing + notarization in CI,
then flip `MAC_AUTO_INSTALL_SUPPORTED = true` in `updater.ts` and macOS
upgrades become automatic too.
### What ships in this PR
- **`electron-updater` integration** in a new `src/app/updater.ts`
module.
- **"Check for Updates…" menu items** are now functional — the existing
disabled placeholder in the app-icon menu, plus new entries in the
Electric Agents menu (macOS) and Help menu (Windows/Linux).
- **Background check on launch** (10s after window comes up) and
unlimited manual checks via the menu.
- **Dock progress bar** during downloads on signed platforms so manual
download clicks give immediate feedback.
### macOS notify-only fallback (until phase 2)
Squirrel.Mac requires a Developer ID signature to swap the bundle, so on
unsigned macOS we behave as a notifier:
- "Check for Updates…" → dialog: "Version X available — Open releases
page / Later"
- Auto check stays silent so it doesn't pop dialogs while users are
mid-task
- **No download is performed** — the file would just be discarded, and
the user has to grab it from the browser anyway
When phase 2 lands, signed macOS users get the same full flow as
Windows/Linux without further code changes.
### Update channel topology
- **Switched publish provider from `github` to `generic`** pointed at
the moving `agents-desktop-latest` tag. The GitHub provider was picking
up the wrong release because `electric-sql/electric` publishes many
packages to the same Releases page (changesets-style) and GitHub's
"latest" marker tracks whichever package was published most recently —
which is rarely the desktop app.
- **Canary builds get full separation** — CI passes `-c.channel=beta`
and overrides `-c.publish.url=…agents-desktop-canary`. Canary builds
emit `beta-*.yml` metadata and ship apps that fetch from the canary tag,
so stable users never accidentally upgrade to canaries.
- **Canary asset publishing** also now uploads the `*.yml` and blockmap
metadata alongside the existing renamed predictable-name copies (the
renames break what the updater metadata references, so we need both).
### Files touched
| File | Change |
| --- | --- |
| `packages/agents-desktop/package.json` | adds
`electron-updater@^6.3.9` |
| `packages/agents-desktop/vite.config.ts` | externalizes
`electron-updater` |
| `packages/agents-desktop/src/app/updater.ts` *(new)* | full updater
module |
| `packages/agents-desktop/src/app/controller.ts` | instantiates
updater, exposes `initializeUpdater` + `checkForUpdates` |
| `packages/agents-desktop/src/main.ts` | calls `initializeUpdater()`
after window is up |
| `packages/agents-desktop/src/ui/application-menu.ts` | enables the
existing placeholder + adds Help menu entry |
| `packages/agents-desktop/electron-builder.yml` | switches publish
provider to `generic` |
| `.github/workflows/agents_desktop_build.yml` | canary channel
separation + metadata upload |
## Followups (not in this PR)
1. **Canary versioning.** Today every canary builds as `0.1.10` because
the workflow's `version: canary-${{ github.run_number }}-${{ github.sha
}}` input isn't injected into `package.json`. Auto-update version
compare won't trigger between canaries until we wire a real semver
prerelease version like `0.1.11-canary.N` into the build.
2. **Phase 2: signing + notarization.** Apple Developer ID cert,
notarization credentials, and GitHub Actions secrets (`CSC_LINK`,
`CSC_KEY_PASSWORD`, plus notarization). Then flip the
`MAC_AUTO_INSTALL_SUPPORTED` constant.
## Test plan
- [x] Local typecheck + production build pass
- [x] Smoke-tested end-to-end on macOS by temporarily downgrading
`package.json` version to `0.0.1` and rebuilding: the app correctly
fetched `latest-mac.yml` from the `agents-desktop-latest` tag, detected
`0.1.10` as available, showed the "Open releases page" dialog
(notify-only path), and re-checking shows the dialog again as expected
- [x] Background auto-check at +10s does not pop a duplicate dialog when
the manual dialog is dismissed (notifier-mode auto checks stay silent)
- [x] Windows installer build picks up `electron-updater` (CI will
exercise this)
- [ ] Linux AppImage build picks up `electron-updater` (CI will exercise
this)
- [ ] First post-merge stable release populates
`agents-desktop-latest/latest-mac.yml` and a subsequent stable upgrade
triggers the "update available" prompt for real users
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f222d39 commit bbf52b6
10 files changed
Lines changed: 427 additions & 13 deletions
File tree
- .changeset
- .github/workflows
- packages/agents-desktop
- src
- app
- ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
| 266 | + | |
262 | 267 | | |
263 | 268 | | |
264 | 269 | | |
265 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
266 | 280 | | |
267 | 281 | | |
268 | 282 | | |
| |||
539 | 553 | | |
540 | 554 | | |
541 | 555 | | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
542 | 563 | | |
543 | 564 | | |
544 | 565 | | |
| |||
555 | 576 | | |
556 | 577 | | |
557 | 578 | | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | 579 | | |
562 | 580 | | |
563 | 581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
308 | 316 | | |
309 | 317 | | |
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
313 | 321 | | |
| 322 | + | |
314 | 323 | | |
315 | 324 | | |
316 | 325 | | |
| |||
345 | 354 | | |
346 | 355 | | |
347 | 356 | | |
348 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
349 | 362 | | |
350 | 363 | | |
351 | 364 | | |
| |||
473 | 486 | | |
474 | 487 | | |
475 | 488 | | |
| 489 | + | |
476 | 490 | | |
477 | 491 | | |
478 | 492 | | |
0 commit comments