Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
fix(updater): degrade auto-update to a manual-download link on Linux .deb/.rpm
enes97148da60d0c
diff --git a/src/main/updater.ts b/src/main/updater.tsindex 67bc88d85..462566276 100644--- a/src/main/updater.ts+++ b/src/main/updater.ts@@ -9,6 +9,7 @@ import { app, ipcMain, Notification } from 'electron'// electron-vite v5's CJS interop.import { autoUpdater } from 'electron-updater'import { IPC } from '../shared/ipc'+import { isManualUpdatePlatform, toUpdateAvailablePayload } from '../shared/update-platform'import { getMainWindow, sendToMain } from './main-window'import { retainUntilDismissed } from './notifications'@@ -43,11 +44,16 @@ export function initUpdater(onBeforeRestart?: () => void): void {return}- autoUpdater.autoDownload = true- autoUpdater.autoInstallOnAppQuit = true+ // A Linux .deb/.rpm install (no APPIMAGE env) cannot self-install and would re-download the+ // full AppImage every 6h only to throw on install. Degrade to a manual-download link: don't+ // auto-download; surface update-available with `manual: true` so the card shows a Download link.+ const manualUpdates = isManualUpdatePlatform(process.platform, !!process.env.APPIMAGE)++ autoUpdater.autoDownload = !manualUpdates+ autoUpdater.autoInstallOnAppQuit = !manualUpdatesautoUpdater.on('update-available', (info) => {- send(IPC.appUpdateAvailable, { version: info.version, notes: info.releaseNotes ?? '' })+ send(IPC.appUpdateAvailable, toUpdateAvailablePayload(info, manualUpdates))})autoUpdater.on('download-progress', (p) => {diff --git a/src/renderer/components/UpdateCard.tsx b/src/renderer/components/UpdateCard.tsxindex 88c933e4d..6d29dd28b 100644--- a/src/renderer/components/UpdateCard.tsx+++ b/src/renderer/components/UpdateCard.tsx@@ -8,6 +8,8 @@ type Status =| { kind: 'idle' }| { kind: 'checking' }| { kind: 'available'; version: string; percent: number }+ // A .deb/.rpm Linux install can't self-install — show a manual download link, no progress/restart.+ | { kind: 'manual'; version: string }| { kind: 'downloaded'; version: string }| { kind: 'upToDate' }| { kind: 'required'; minSupported: string | null }@@ -22,7 +24,11 @@ export function UpdateCard(): JSX.Element | null {useEffect(() => {const offAvailable = window.nodeTerminal.updates.onAvailable((info) => {- setStatus({ kind: 'available', version: info.version, percent: 0 })+ setStatus(+ info.manual+ ? { kind: 'manual', version: info.version }+ : { kind: 'available', version: info.version, percent: 0 }+ )setMinimized(false)})const offProgress = window.nodeTerminal.updates.onProgress((p: UpdateProgress) => {@@ -60,7 +66,10 @@ export function UpdateCard(): JSX.Element | null {useEffect(() => {const onChecking = () => {setStatus((s) =>- s.kind === 'available' || s.kind === 'downloaded' || s.kind === 'required'+ s.kind === 'available' ||+ s.kind === 'manual' ||+ s.kind === 'downloaded' ||+ s.kind === 'required'? s: { kind: 'checking' })@@ -77,7 +86,7 @@ export function UpdateCard(): JSX.Element | null {void window.nodeTerminal.updates.getPolicy().then((p) => {if (!p.mandatory) returnsetStatus((s) =>- s.kind === 'available' || s.kind === 'downloaded'+ s.kind === 'available' || s.kind === 'manual' || s.kind === 'downloaded'? s: { kind: 'required', minSupported: p.minSupported })@@ -125,7 +134,9 @@ export function UpdateCard(): JSX.Element | null {? 'Checking for updates…': status.kind === 'available'? 'Downloading Update'- : status.kind === 'downloaded'+ : status.kind === 'manual'+ ? 'Update available'+ : status.kind === 'downloaded'? 'Update ready': status.kind === 'upToDate'? "You're up to date"@@ -135,7 +146,10 @@ export function UpdateCard(): JSX.Element | null {const canMinimize = status.kind === 'available' || status.kind === 'downloaded'const canDismiss =- status.kind === 'downloaded' || status.kind === 'upToDate' || status.kind === 'error'+ status.kind === 'manual' ||+ status.kind === 'downloaded' ||+ status.kind === 'upToDate' ||+ status.kind === 'error'return (<div className="update-card">@@ -170,6 +184,17 @@ export function UpdateCard(): JSX.Element | null {</>)}+ {status.kind === 'manual' && (+ <>+ <p className="update-card__body">+ nodeterm v{status.version} is available. Download it to update.+ </p>+ <button className="update-card__btn" onClick={openReleases}>+ Download+ </button>+ </>+ )}+{status.kind === 'downloaded' && (<><p className="update-card__body">nodeterm v{status.version} is ready to install.</p>diff --git a/src/shared/types.ts b/src/shared/types.tsindex 8d34f2ec6..1d3b84630 100644--- a/src/shared/types.ts+++ b/src/shared/types.ts@@ -788,6 +788,12 @@ export interface GitApi {export interface UpdateInfo {version: stringnotes?: string+ /**+ * The update cannot self-install and must be downloaded manually (Linux .deb/.rpm: no+ * APPIMAGE env, so electron-updater's quitAndInstall would throw). The card shows a+ * download link instead of the download-progress/restart flow. Absent/false = self-installs.+ */+ manual?: boolean}export interface UpdatePolicy {diff --git a/src/shared/update-platform.test.ts b/src/shared/update-platform.test.tsnew file mode 100644index 000000000..8732594d0--- /dev/null+++ b/src/shared/update-platform.test.ts@@ -0,0 +1,42 @@+import { describe, expect, it } from 'vitest'+import { isManualUpdatePlatform, toUpdateAvailablePayload } from './update-platform'++describe('isManualUpdatePlatform', () => {+ it('linux with APPIMAGE set → auto (self-installs)', () => {+ expect(isManualUpdatePlatform('linux', true)).toBe(false)+ })++ it('linux without APPIMAGE → manual (.deb/.rpm)', () => {+ expect(isManualUpdatePlatform('linux', false)).toBe(true)+ })++ it('darwin → auto regardless of APPIMAGE', () => {+ expect(isManualUpdatePlatform('darwin', false)).toBe(false)+ expect(isManualUpdatePlatform('darwin', true)).toBe(false)+ })++ it('win32 → auto', () => {+ expect(isManualUpdatePlatform('win32', false)).toBe(false)+ })+})++describe('toUpdateAvailablePayload', () => {+ it('carries version + string release notes + manual flag', () => {+ expect(toUpdateAvailablePayload({ version: '1.2.0', releaseNotes: 'fixes' }, true)).toEqual({+ version: '1.2.0',+ notes: 'fixes',+ manual: true+ })+ })++ it('coerces non-string / missing release notes to empty string', () => {+ expect(toUpdateAvailablePayload({ version: '1.2.0' }, false)).toEqual({+ version: '1.2.0',+ notes: '',+ manual: false+ })+ expect(+ toUpdateAvailablePayload({ version: '1.2.0', releaseNotes: [{ note: 'x' }] }, false).notes+ ).toBe('')+ })+})diff --git a/src/shared/update-platform.ts b/src/shared/update-platform.tsnew file mode 100644index 000000000..ba253e959--- /dev/null+++ b/src/shared/update-platform.ts@@ -0,0 +1,28 @@+/**+ * Auto-update platform capability — pure, so it unit-tests without an Electron/Node process.+ *+ * electron-updater can only self-install where it knows how to relaunch the new binary. On+ * Linux that path exists only for AppImage installs (the running AppImage's path arrives via+ * the `APPIMAGE` env var, which quitAndInstall re-execs). A .deb / .rpm install has no+ * APPIMAGE, so quitAndInstall throws "APPIMAGE env is not defined" AND every 6h check would+ * still download the full ~231MB AppImage for nothing. For that case we degrade to a+ * manual-download link. macOS (dmg/zip) and Windows self-install as before.+ */+import type { UpdateInfo } from './types'++/** True when this OS/install combination cannot self-install and must download manually. */+export function isManualUpdatePlatform(platform: string, hasAppImage: boolean): boolean {+ return platform === 'linux' && !hasAppImage+}++/** Reduce an electron-updater update-available info to the renderer's UpdateInfo payload. */+export function toUpdateAvailablePayload(+ info: { version: string; releaseNotes?: unknown },+ manual: boolean+): UpdateInfo {+ return {+ version: info.version,+ notes: typeof info.releaseNotes === 'string' ? info.releaseNotes : '',+ manual+ }+}