Repository navigation
ci(desktop): attach the desktop app and its update feed to releases (needs owner OK) - #2793
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Review round (omo: CLEAR at 42fad50; Codex adversarial, Terra, at 42fad50):
Validation for the fix: actionlint on both workflows (0 findings). |
…the static AppImage runtime
…ed, and require every installer
|
Review round 2 (omo: CLEAR at de73e78; Codex adversarial, Terra, at de73e78), after the versionless names, deb and static AppImage runtime:
|
…only the signing secrets, and leave the latest release's files alone
|
Review round 3 (omo: BLOCK at e6fca51), resolved in the next commit:
|
|
Owner-approved (delegated to the lead on 2026-11-05): release workflow changes for the desktop app and the use of the Mac signing secrets behind DESKTOP_MAC_SIGN. |
|
deb dependencies (f52dbb0): electron-builder's default Validation:
|
…igned release builds
|
Merge note: part of the desktop release; owner decisions delegated to the lead. omo CLEAR at this head, Codex rounds done (no reproduced HIGH left), required checks green. CodeRabbit skipped or rate-limited; findings and resolutions are in the PR comments. |
#2828) ## What The desktop app's .deb installs now update themselves. Until now `updates.ts` turned updates off on Linux unless the app ran as an AppImage, so everyone who installed the .deb stayed on their first version. electron-updater 6.8.11 (already a dependency) ships `DebUpdater`, which downloads the `.deb` listed in the same `latest-linux*.yml` feed. Ovis uses its download, its password prompt runner (pkexec, gksudo/kdesudo, or sudo) and its restart. It replaces the install step with a single `apt-get install -y --no-remove <file>`: - DebUpdater's default `dpkg -i` path runs `apt-get install -f -y` after any dpkg failure. Cancelling the prompt therefore asked a second time, and once that no-op repair succeeded, Ovis restarted on its old version (reproduced below). - Its apt path adds `--allow-unauthenticated --allow-downgrades --allow-change-held-packages`. - `apt-get --no-remove` installs the file and its dependencies in one command, fails when nothing was installed, and stops rather than remove another package. Other changes: - `updatePlan` returns the installer to use: `appimage`, `deb` (electron-builder's `resources/package-type` says `deb`), or electron-updater's default on macOS. Other Linux installs stay off. - The app counts as an AppImage only when `APPIMAGE` and `APPDIR` are set and it runs from `APPDIR`. A bare `APPIMAGE` may be inherited from another AppImage that started Ovis (a terminal, an editor), and the AppImage updater would overwrite that file. Ovis also picks the updater class itself because electron-updater goes by `package-type` alone. electron-builder writes that file into the shared `linux-unpacked` folder the AppImage is built from too. - A .deb installs only from **Restart to Update** in the tray, never on a plain quit (`autoInstallOnAppQuit = false`), so quitting never shows a password prompt. The install runs before the server stops: if the prompt fails or is cancelled, the app and its server keep running and the tray item stays. The AppImage path is unchanged. `electron-builder.yml` is unchanged. The deb target and the release feed come from #2793, so releases get nothing from this PR until that one lands. ## Validation - `bun run check fast`: passed (exit 0) at the head's code. - `app/electron`: `bun test src/updates.test.ts` passes, and the new Linux cases failed before the change. `bun run typecheck` passes. `bun test` for the whole folder sometimes fails in `children.test.ts` (`installCore`). That file is untouched here, and the failure comes and goes between runs. - End to end in an `ubuntu:26.04` container. Two .deb builds of this branch: 0.4.90 installed, 0.4.91 in an https generic feed. The app ran as a normal user on Xvfb. The **Restart to Update** action was triggered through the main process inspector. - First commit: after the download, a plain quit installed nothing. With no sudo rights, Restart to Update failed, and the app and server kept running (HTTP 200). With sudo rights, it installed 0.4.91 and restarted, and the server answered HTTP 200. - Head, with a stand-in `pkexec` that refuses the first request and allows later ones. Cancelling: one prompt, `Update failed: Command pkexec exited with code 126`, the app kept running (same PID), still 0.4.90. The next Restart to Update ran `apt-get install -y --no-remove <file>` once, installed 0.4.91, and restarted the app, and its server answered HTTP 200. Before the fix, cancelling produced a second prompt (`apt-get install -f -y`), and Ovis restarted, still on 0.4.90. - Head: the AppImage run with `--appimage-extract-and-run` still checks for updates. A .deb started with `APPIMAGE=/tmp/Other.AppImage APPDIR=/tmp/.mount_Other` updates as a .deb, and `Other.AppImage` was left alone. - `ubuntu-desktop-minimal` on 26.04 depends on pkexec/polkit, so desktop installs get the graphical prompt. sudo is only the fallback. - Not run: a real desktop session with a polkit agent (the dialog itself). ## Review notes - omo (BLOCK at 1da13a7). HIGH: a stray `APPIMAGE` selected the AppImage updater, which would overwrite another app. Fixed and tested as above. MEDIUM: the apt flags. Fixed by using our own apt-get command. LOW: the process-wide env override. Gone. - Codex Terra. HIGH: a dpkg failure was treated as success. Reproduced and fixed. HIGH/MEDIUM: apt `-y` with the `--allow-*` flags, and the dpkg fallback when apt is absent. Fixed by the same command. HIGH: no deb target in `electron-builder.yml`. That comes from #2793. - Left as is (LOW/MEDIUM, not blocking): - A .deb built without an embedded feed ignores `OVIS_UPDATE_URL`, because electron-builder writes `package-type` only with a publish config. Release builds carry the feed. - sudo without a terminal cannot prompt (only when no pkexec, gksudo or kdesudo is installed). - Install failures are only logged, and the tray item stays. - The main process blocks while the password dialog is open (upstream `spawnSync`). - A single quote in the cache path breaks electron-updater's `bash -c` (upstream).
…r a named pipe (needs owner OK) (#2814) ## Summary The desktop app (`app/electron`) now builds for Windows x64, and the server serves the herdr-core runtime on Windows. herdr-core 0.1.17 ships `herdr-core-windows-x86_64.zip` (`herdr-core.exe` plus the ConPTY it runs terminals on, `conpty\`), and listens on a named pipe. The server already talks to hc through `hc connect` over stdin/stdout, so the only missing piece was the adapter the server's herdr client connects to (`HERDR_SOCKET`), which listened on a unix socket file. ### Server - `server/herdr-core/pipe.ts` (new): the adapter's address. Outside Windows it stays `herdr-core.sock` in the state folder. On Windows it is `\\.\pipe\ovis-herdr-core-<sha256 of the lowercased, resolved state folder>`, so two servers on one state folder still meet on one pipe and the second one is refused, as with the socket file. - `server/herdr-core/runtime.ts`: herdr-core is served on Windows too. The owner-uid and mode checks (`chmod 0700/0600`) run only outside Windows. `herdr/client.ts` already leaves a `\\.\pipe\` address as it is. - On Windows the pipe is named after the state folder's real path (`realpathSync.native`), so a junction or a short 8.3 spelling of the same folder names the same pipe. - `server/completion.ts`: the completion tracker's herdr identity does not `stat` a named pipe (a stat opens a connection to the adapter). `pipeIdentity` (the pipe's name plus a per-process nonce) stands instead, as below. - `server/herdr-core/discovery.ts`: a stat of hc's own Windows pipe answers EBUSY while each of its instances is taken. That now counts as a running core (it read as not running in the VM with the core up). - `server/herdr-core/adapter.ts`: on Windows `server.agent_manifests` offers no kinds. hc's shell there is PowerShell or cmd, which the typed agent start does not quote for, and `agent.start` already refuses it (`agent_pane_unsupported`). Starting an agent from a pane stays a follow-up. - `server/agents-routes.ts`: `/api/agents` adds Oh My Pi and Claude Code itself only on herdr (whose built-ins they are). On herdr-core the adapter's manifests already name every kind its panes can start, so Windows offers none it cannot start (the omo review reproduced Claude Code being offered and then failing with `agent_pane_unsupported`). The new test fails without the change. - `server/finishes.ts`: on Windows `finishHerdrIdentity` reads `HERDR_SOCKET` as herdr's `pid:start` marker file. With the adapter's pipe there, that `readFileSync` would connect to the adapter and wait for an answer that never comes, blocking the server. `pipeIdentity` stands instead: the pipe's name plus a nonce made once per server process. So like the socket file recreated on every start on Linux and macOS, it changes with each server and stays the same while one runs. - The Settings runtime switch and the automatic choice stay herdr-only on Windows (`runtime-choice.ts` unchanged): only an explicit `OVIS_RUNTIME=herdr-core`, which the desktop app sets, serves herdr-core there. ### Desktop app - `scripts/runtimes.ts`: a `win32-x64` target, with pinned hc (`windows-x86_64.zip`, SHA-256 from releases.herdr.dev's 0.1.17 manifest) and Bun (`bun-windows-x64.zip`, from Bun 1.4.2's SHASUMS256.txt). - `scripts/build.ts`: unpacks with Windows' own `tar.exe` (Git Bash's GNU tar cannot open zips), stages `herdr-core.exe`, `conpty\` and `bun.exe`, keeps hc's `THIRD-PARTY-NOTICES\` folder (ConPTY's license and notice), and runs `electron-builder --win`. - `electron-builder.yml`: an NSIS target, one-click and per user (no administrator prompt), `Ovis-win-x64.exe` (versionless, like the Linux and macOS names on main). It installs to `%LOCALAPPDATA%\Programs\ovis-desktop` (from `package.json`'s name), so it does not overwrite the Windows shell's `%LOCALAPPDATA%\Programs\Ovis`. Both add a Start Menu entry named **Ovis**. Unsigned: no signing settings or secrets were added. - `scripts/build.ts` writes the Windows `.ico` (PNG entries, 16 to 256 px, through `Bun.Image`). electron-builder's own PNG conversion spun for over 10 minutes on the 1024 px icon under Bun's node in the VM. - `src/children.ts`: - The `.exe` names. - The first copy of the core into user data takes `conpty\` along, before the exe. `hc update --from` already brings the bundled one's ConPTY. - No `/bin/bash` wrapper on Windows. - `windowsHide` on every child. - Without `ps`, a leftover server's command line and start time come from CIM (`Get-CimInstance Win32_Process`). Windows' quoted program path is accepted. ### Release (workflow change: needs the owner's OK) - `.github/workflows/desktop.yml`: - Adds a `win32-x64` build on `windows-2025`. Its steps run in bash, as on the other runners, with Git Bash on Windows. - Its `Ovis-win-x64.exe`, `.blockmap` and `latest.yml` go into the release files. - `latest.yml`, `Ovis-win-x64.exe` and its blockmap join the names the gather step requires before anything is attached. - A Windows signing hook mirrors the Mac one: off until the repository variable `DESKTOP_WIN_SIGN` is `true`, then electron-builder signs with `WIN_CSC_LINK` (base64 .pfx) and `WIN_CSC_KEY_PASSWORD`, and the build fails if either is missing. Unsigned until then. - `.github/workflows/release.yml` passes those two secrets to the desktop call (empty when unset). - `windows-app.yml` (`Ovis.exe`, `Ovis.msix` of the Windows setup app) is unchanged. - `app/electron/src/children.test.ts`: the tests built on POSIX shell stand-ins (startServer, endLeftover, the hc swap and rollback) are skipped on Windows, so the Windows job's `bun test` runs the rest: 39 pass, 10 skip, 0 fail in the Windows VM. - `docs/development.md` lists the Windows installer and its feed. ## Validation - After merging origin/main (#2793's mac signing/deb kept; the Windows build takes its versionless name): Windows VM on `8f223a5f` passed build (`Ovis-win-x64.exe`), silent install, launch, `/api/health` `runtime: herdr-core` with `herdr_core.running: true`, an hc terminal in `/api/session`, and uninstall. `bun run check fast` green on `94ea82fe` (11345 pass). The agents fix is server-only and covered by `server/agents-routes.test.ts`; the VM run was not repeated for it. - Linux: `bun run check fast` (result below); `bun test server/herdr-core/pipe.test.ts server/herdr-core/runtime.test.ts server/herdr-core/runtime-choice.test.ts server/finishes.test.ts`; in `app/electron`, `bun test` (33 pass) and `bun run typecheck`. - Windows 11 VM (desktop session, fresh `%TEMP%` clone of this branch, deleted afterwards; isolated `HC_SESSION` and `--user-data-dir`): - Probe: Bun 1.4.2 `Bun.listen`/`Bun.connect` on `\\.\pipe\…` work; a second listener gets EADDRINUSE; a closed pipe answers ENOENT (so the adapter's existing "another Ovis still listens" check holds); `hc server start` and `hc connect` answer hello. - `bun test` of the four server files above: the new Windows test passes (the adapter listens on the pipe, `HERDR_SOCKET` points at it, a second server on the same state folder is refused, and a restart takes the pipe again). See the note below on the one other failure. - E2E on this branch (`bun run dist`, silent install, launch with an isolated `--user-data-dir` and `HC_SESSION`, then uninstall): - The build makes `Ovis-win-x64.exe` (221.6 MB), whose `resources\ovis\bin` holds `herdr-core.exe`, `bun.exe` and `conpty\conpty.dll`/`conpty\x64\OpenConsole.exe`. - `/S` installs to `%LOCALAPPDATA%\Programs\ovis-desktop\Ovis.exe` with a Start Menu `Ovis.lnk`. - The app starts the core and the server (`Ovis listening on http://127.0.0.1:60163`), and `/api/health` answers `"runtime":"herdr-core"`, `"herdr_runtime":{"serving":"herdr-core","source":"env"}`. - The adapter listens on `\\.\pipe\ovis-herdr-core-0d6e9e8573bf0849ab16ad1ce5f232a6`. - A terminal started with `hc run --bg cmd.exe …` in the app's core session shows up in the server's `/api/session` as pane `t1` ("Other terminals"). - The uninstaller (`/currentuser /S`) removes the folder, the shortcut and the uninstall key. Skipped: the `Native Windows install` CI set is unchanged by this PR and runs in CI. Note: `server/herdr-core/runtime-choice.test.ts` "keeps herdr wherever herdr's TUI left a trace" fails when run on Windows, through a path this PR does not touch: it simulates `platform: "linux"` and expects `Bun.which` to find an extensionless `custom-herdr` on Windows. That file is not in the Windows CI set.
What
Releases now carry the desktop app (
app/electron) and the files it updates itself from.ubuntu-24.04), Linux arm64 (ubuntu-24.04-arm), macOS arm64 (macos-15) and macOS x64 (macos-15-intel). Pull requests touching the app and manual runs without a tag only build, as before (now on all four targets).taginput (Release calls it afterpublish, or run it by hand frommainfor an existing release) it:OVIS_RELEASE_TAG(the build stops unlesspackage.jsonsays the tag's version) andOVIS_UPDATE_FEED=https://github.com/<repo>/releases/latest/download.feed(read-only, no secrets): merges the two Mac builds'latest-mac.ymlinto one (electron-updater reads one file and picks the arm64 or x64 files by name) and gathers everything to attach, failing unless every installer and feed is there.attach(the only job withcontents: write, runs no repository code): uploads the installers and blockmaps first, thenlatest-linux.yml,latest-linux-arm64.ymlandlatest-mac.yml, with--clobberso a rerun repairs a release.desktopjob afterpublish;mac-dmgandwindows-appnow run after it, so the release becomes GitHub's latest (which they decide) only with the desktop files attached andreleases/latest/download/<name>never 404s.Ovis.dmg,Ovis.exe, the PTY host and the shell assets are untouched.releases/latest/download/<name>always gives the newest:Ovis-linux-x64.deb,Ovis-linux-arm64.deb,Ovis-linux-x64.AppImage,Ovis-linux-arm64.AppImage,Ovis-mac-arm64.dmg,Ovis-mac-x64.dmg,Ovis-mac-arm64.zip,Ovis-mac-x64.zip(+.blockmap).scripts/build.tswrites the CPU into the name itself, since electron-builder's${arch}saysx86_64for an AppImage andamd64for a deb. None collides withOvis.dmg/Ovis.exe.debtarget beside the AppImage (the download for Ubuntu/Debian), and the AppImage uses electron-builder's static AppImage runtime (toolsets.appimage: '1.0.3'), which needs no libfuse2 (missing on recent Ubuntu); without FUSE at all it runs withAPPIMAGE_EXTRACT_AND_RUN=1. Only the AppImage updates itself on Linux (assrc/updates.tsalready says); a deb is updated by installing the new one.https://github.com/devswha/ovis/releases/latest/download, which electron-updater's generic provider follows through GitHub's redirect. An installed app therefore sees a version when it becomes GitHub's latest, the same momentovis.sh/Ovis.dmgandovis.sh/Ovis.exemove.DESKTOP_MAC_SIGN=true, the Mac release builds sign and notarize with the existingMAC_*secrets (passed to electron-builder asCSC_LINK/CSC_KEY_PASSWORDandAPPLE_API_KEY/APPLE_API_KEY_ID/APPLE_API_ISSUER), and fail if one is missing. The entitlements and hardened-runtime config are left to the Mac signing work; until then the Mac files are unsigned, and an unsigned Mac app does not update itself.app/electron/scripts/feed.ts(+ tests) holds the merge;bun scripts/build.ts merge-feed <out> <feeds>…runs it. Its output is JSON, which is YAML, so no value changes type.This PR changes workflows and how signing secrets are passed, so it needs the owner's OK.
Validation
bun run check fast: passed (workflow syntax/actionlint, generated files, typecheck, build, unit 11247 pass).app/electron:bun test(33 pass, including the newfeed.test.ts),bun run typecheck.OVIS_UPDATE_FEEDset: electron-builder wrotedist/latest-linux.ymlunder--publish neverandresources/app-update.ymlwithprovider: genericand the feed URL;merge-feedoutput loads with electron-updater's js-yaml (releaseDatestays a string);OVIS_RELEASE_TAG=v9.9.9stops the build with a version mismatch.bun scripts/build.ts packagewith the new config:dist/Ovis-linux-x64.AppImageanddist/Ovis-linux-x64.deb,latest-linux.ymllisting both;filereports the AppImage asstatic-pie linked; inubuntu:24.04withfuse3and nolibfuse.so.2,--appimage-mountmounted it and listedresources/ovis/bin/{bun,herdr-core};dpkg-deb -Ishowsovis-desktop,amd64, the maintainer and Electron's usual Depends.src/children.test.ts"installCore > swaps a different copy ... with hc update --from" fails about half the runs on main alone (ENOENT on itsovis.log).