Skip to content

fix(linux): launch the AppImage terminal daemon through its own mount - #27435

Merged
OrcaWin merged 8 commits into
mainfrom
OrcaWin/appimage-daemon-own-mount
Oct 11, 2026
Merged

OrcaWin merged 8 commits into
mainfrom
OrcaWin/appimage-daemon-own-mount

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​333 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​333
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​210 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​192

Copy of #23457 by @sergeytiron, brought up to date with main plus one small fix so it can land without more work from the author. Every original commit is kept with its authorship. Thank you, Sergey.

ELI5

On Linux, the AppImage runs Orca out of a temporary mounted folder that disappears when the Orca window quits. The terminal background service (the daemon) is meant to keep running after the window closes, but it was started from that same folder. Once the folder went away, the daemon crashed the next time it needed code it had not loaded yet, and every open terminal went with it. Now the daemon is started through the AppImage file itself, so it gets its own folder, which lasts as long as the daemon does.

What Changed

  • Before: on a Linux AppImage the daemon ran from the window's mount. Minutes to days after the window closed, it crashed (SIGBUS) and took every terminal with it.
  • After: on a Linux AppImage running from its own FUSE mount, the daemon is started by running $APPIMAGE itself. A short bootstrap finds the daemon entry inside the new mount and refuses to run if the file at $APPIMAGE is now a different release. If that launch fails for any reason, Orca falls back to today's launch from the current mount, so a broken AppImage start never costs the daemon.
  • The daemon records a stable identity ($APPIMAGE plus the entry path), so the next window can adopt a surviving daemon even though every launch mounts at a new random folder.
  • Extract-and-run (APPIMAGE_EXTRACT_AND_RUN=1 / --appimage-extract-and-run), deb, rpm, tarball, macOS and Windows do not meet the "validated AppImage on its own FUSE mount" check and keep today's launch unchanged.
  • Our fix commit: the original also stopped retrying when a failed child could not be cleaned up. That is correct for the AppImage attempt, but it also changed the existing retry on non-AppImage Linux. That veto now applies only to the AppImage attempt, so deb/rpm/tarball launches behave exactly as before. A test locks this in.

Why

Electron always starts helpers from the executable's folder, so the daemon cannot simply be moved out of the mount. Starting it through the AppImage gives it its own runtime and mount, created inside the daemon's own scope. Copying the app elsewhere first would cost about 500 MB per release and is a larger follow-up.

Linked Issue

Part of #18200 (terminal loss after the window closes). Likely prevents #23648, which stays open for its separate session-classification ask.

Visual Proof

N/A: no UI change.

Testing

  • The author tested real hosts (Ubuntu 20.04 and 26.04): see fix(linux): launch the AppImage terminal daemon through its own mount #23457.

  • Focused unit tests, pnpm tc, oxlint, pnpm run check:code-quality:changed and pnpm lint pass locally on this branch.

  • CI's Linux package job builds the AppImage and runs the extract-and-run serve and desktop-startup cases and the no-FUSE CLI cases in containers.

  • Automated tests added/updated

Review

P0/P1 review by a second model flagged the non-AppImage retry change; fixed in the last commit.

Agent skill upstream boundary

  • Not applicable.

Notes

Only the Linux AppImage path changes. SSH: the daemon is local, so remote work is unaffected.

Supersedes #23457.

sergeytiron and others added 8 commits September 27, 2026 21:18
In an AppImage the daemon ran from the window's FUSE mount, which the
runtime unmounts when the window exits or the session ends; the surviving
daemon then SIGBUSed on its next cold page and took every terminal with it.
Launch it through $APPIMAGE instead so it gets its own runtime and mount,
scoped with the daemon, falling back to the in-mount launch on failure.

Part of #18200

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each AppImage launch mounts at a fresh random dir, so a daemon that now
survives its window recorded an entry path the next window could never
match, and an idle survivor was replaced as 'different app path'. Record
and compare $APPIMAGE plus the in-image entry path instead; a new
release at the same path is still caught by the app-version check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The cleanup-failure veto now applies only to the AppImage attempt, so a
.deb/.rpm/tarball scoped launch whose cleanup fails still retries unscoped
exactly as before.

Co-authored-by: Sergey Tiron <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 52e09a68-7861-4b1e-a246-2de69fe67057

📥 Commits

Reviewing files that changed from the base of the PR and between 6239c0c and 7a827d1.


📒 Files selected for processing (8)
  • src/main/daemon/daemon-appimage-launch.test.ts
  • src/main/daemon/daemon-appimage-launch.ts
  • src/main/daemon/daemon-launched-child-identity.test.ts
  • src/main/daemon/daemon-launched-child-spawn.test.ts
  • src/main/daemon/daemon-launched-child-spawn.ts
  • src/main/daemon/daemon-launched-child.ts
  • src/main/daemon/daemon-out-of-process-launcher-identity.test.ts
  • src/main/daemon/daemon-out-of-process-launcher.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.



📝 Walkthrough

Walkthrough

The daemon launcher now resolves AppImage metadata for validated FUSE-mounted images and builds a child command that checks the packaged version before loading the daemon entry. The launcher passes AppImage identity and launch data through replacement preflight and child spawning. Eligible AppImage launch failures retry without AppImage options. Endpoint-unavailable and startup-cleanup failures propagate, and PID cleanup uses the launched child’s identity nonce.


Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 7a827

No actionable issue was found that should prevent merging. The packaged AppImage launch should still receive its normal build and startup checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: launching the Linux AppImage terminal daemon through its own mount.
Description check Passed The description is mostly complete. It includes the user impact, implementation details, rationale, linked issues, testing information, visual-proof status, scope notes, and review context. It could i…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit b53ba14 into main Oct 11, 2026
42 checks passed
@OrcaWin
OrcaWin deleted the OrcaWin/appimage-daemon-own-mount branch October 11, 2026 10:44
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.

2 participants