Skip to content

Orphaned Runtime Host outlives the desktop app and blocks the next launch #4111

Description

@Astro-Han

What happened

Killing the desktop app's Electron main process leaves its Runtime Host process running. The next launch — from any worktree sharing the workspace — stops at the startup dialog "旧版 Runtime Host 正在运行 / 另一个 Runtime Host 进程仍占用此工作区" and waits indefinitely for a process whose parent is already gone.

The dialog offers "wait for the current Host to exit", but nothing is going to exit: the Host outlived the app that spawned it and has no remaining supervisor. The only way forward is to find and kill it by hand.

This makes "restart the dev app" unreliable in exactly the situation where it is used most — iterating across worktrees, where the app is stopped by signal rather than by Cmd-Q.

How to reproduce

  1. Start the dev app from a worktree: npm start -w @maka/desktop.
  2. Let it finish starting so the Runtime Host is up.
  3. Kill the Electron main process rather than quitting the app: pkill -f "<worktree>/apps/desktop".
  4. Observe that a Runtime Host process from that worktree is still running.
  5. Start the dev app again (same or another worktree).
  6. Observed: the startup dialog reports a prior Runtime Host holding the workspace and the app never proceeds. In this session it sat there until a 10-minute timeout, then again on a second attempt.

Expected: the Runtime Host exits with the app that owns it, or the next launch reclaims a workspace whose Host has no live parent.

Environment

Maka 0.2.0, dev build, Electron 43.4.1 / Chrome 150, Node 24.18.1, darwin 25.6.0 (arm64), locale zh-CN. Workspace ~/Library/Application Support/Maka Dev/workspaces/default.

Logs, screenshots, or additional context

Diagnostic report captured on the blocked launch:

Surface: startup
Title: 旧版 Runtime Host 正在运行
Description: 另一个 Runtime Host 进程仍占用此工作区。
已运行约 1 分钟
目标: 1
Main process uptime: 12s

Recent main-process logs (2)
[2026-08-28T18:41:38.172Z] LOG [startup] app ready
[2026-08-28T18:41:38.756Z] LOG [shell-env] resolved login-shell PATH (32 entries)

Recent local Runtime Host process exits (0)
<none captured>

Runtime Host
Diagnostics unavailable: Runtime Host diagnostics were unavailable before the app opened

"Recent local Runtime Host process exits (0) — none captured" is consistent with the reading above: the Host did not exit, it was inherited.

Found while capturing before/after recordings for #4105, where it blocked the run twice.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions