You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explicitly quitting Maka Desktop can leave the Desktop-owned ephemeral Runtime Host alive when durable residency exists. The surviving Host continues to hold the sole State Root writer, so a later Desktop generation or compatibility epoch cannot start against that root. Waiting does not converge while recurring durable work keeps the old Host resident; the current workaround is to identify and terminate the process manually.
Expected behavior: a full Quit Maka action is maintenance authorization for the Desktop-owned local ephemeral Host. It should retire that exact Host and release the writer before Desktop completes a clean exit. Closing only one Surface must remain distinct and must not stop a shared or operator-owned Host.
Start Desktop with its local ephemeral Runtime Host.
Create durable residency, such as an active recurring Scheduled Task.
Explicitly quit Desktop without manually terminating the Host.
Confirm that the Host remains alive and still owns the State Root writer.
Start a later Desktop generation or compatibility epoch against the same State Root.
Observe that Runtime Host election / State Root writer acquisition cannot complete. If the conflict UI is reached, Wait cannot converge while recurring residency remains.
Terminate the surviving Host manually and observe that startup completes.
Environment
Maka commit reproduced on macOS: 3f5c4bb08
Current implementation rechecked on main: 1e1c886ae
Runtime Host lifecycle: Desktop-owned local ephemeral
Logs, screenshots, or additional context
Reproduction evidence
The macOS reproduction recorded:
surviving Host: PPID 1 while retaining the State Root writer;
stale Electron singleton owner PID gone while SingletonSocket remained;
runtime.sqlite / runtime.sqlite-wal still open;
the next Desktop launch blocked in Runtime Host election / writer acquisition;
terminating the surviving Host allowed startup to complete immediately.
#3231 contains a Windows reproduction where an active Scheduled Task kept the epoch 24 Host resident and the epoch 25 Desktop could offer only Wait or Cancel Startup.
#3348 explicitly left normal-quit Host survival untouched. Its proposed registration/PID residue sweep was removed after review because PID termination could not be bound atomically to the authenticated Host; the PR closed with no functional fix. This issue must not revive registration-only PID killing.
Required behavior
When Electron is performing an explicit full application quit:
treat the action as maintenance authorization for the Desktop-owned local ephemeral Host;
stop candidate launches and bind retirement to the exact adopted Host identity/epoch;
wait until the Host releases Domain resources and the sole State Root writer before completing application exit;
leave local service-mode Hosts and managed remote Hosts running;
report a truthful, bounded failure instead of silently claiming clean quit if safe retirement cannot complete.
Window-only close and full Quit Maka must have explicit, tested product semantics on each platform.
Acceptance criteria
Native Quit Maka / Cmd+Q / an equivalent explicit full-quit path retires the exact Desktop-owned ephemeral Host even when a Scheduled Task, Goal, or Automation holds durable residency.
Desktop does not finish clean shutdown until writer release is observed, or reports an actionable retirement failure.
Starting Maka again against the same State Root does not require manual process termination.
Durable schedules and continuation intent recover when Maka starts again; no background Host work runs while Maka is fully stopped.
In-flight work is recovered from a supported durable checkpoint or recorded as explicitly interrupted; unresolved external effects remain result_unknown.
Managed remote and local service-mode Hosts are not retired by Desktop quit.
Tests cover idle and durable-resident local Hosts, active execution, retirement failure, and platform-specific window-close/full-quit mapping.
Architecture boundaries
Two Draft PRs cover complementary parts of one larger lifecycle problem:
#3254 is not limited to takeover of a “truly idle” incompatible Host: it records a real epoch-24 takeover while a scheduled-task residency existed. That capability is legacy-dependent because the current Host kernel's generation-takeover path requires #isTrueIdle(). The system therefore lacks a stable, forward-compatible management contract for every incompatible durable-resident Host.
Neither Draft PR defines the final lifecycle authority. The target architecture is one local Host reconciliation system with one lifecycle owner, one artifact identity, one epoch fence, and one transition state machine shared by Desktop, installed CLI, and TUI presentation adapters.
English
What happened
Explicitly quitting Maka Desktop can leave the Desktop-owned ephemeral Runtime Host alive when durable residency exists. The surviving Host continues to hold the sole State Root writer, so a later Desktop generation or compatibility epoch cannot start against that root. Waiting does not converge while recurring durable work keeps the old Host resident; the current workaround is to identify and terminate the process manually.
Expected behavior: a full Quit Maka action is maintenance authorization for the Desktop-owned local ephemeral Host. It should retire that exact Host and release the writer before Desktop completes a clean exit. Closing only one Surface must remain distinct and must not stop a shared or operator-owned Host.
This is the urgent local Desktop slice of #3231.
How to reproduce
Environment
3f5c4bb08main:1e1c886aeephemeralLogs, screenshots, or additional context
Reproduction evidence
The macOS reproduction recorded:
PPID 1while retaining the State Root writer;SingletonSocketremained;runtime.sqlite/runtime.sqlite-walstill open;#3231 contains a Windows reproduction where an active Scheduled Task kept the epoch 24 Host resident and the epoch 25 Desktop could offer only Wait or Cancel Startup.
Verified current implementation
before-quitrunscloseRuntimeHostDesktop.closeRuntimeHostDesktopcallsruntimeHostManager.close().RuntimeHostDesktopManager.close()closes reconnect lifecycles and Client resources, but does not request retirement of the owned local Host.host.upgrade.prepareand waits for the exact adopted Host PID to exit isprepareForUpdate.Durable residency therefore turns explicit Desktop quit into Surface-only disconnection at the Runtime Host boundary.
Why #3348 did not fix this
#3348 explicitly left normal-quit Host survival untouched. Its proposed registration/PID residue sweep was removed after review because PID termination could not be bound atomically to the authenticated Host; the PR closed with no functional fix. This issue must not revive registration-only PID killing.
Required behavior
When Electron is performing an explicit full application quit:
Window-only close and full Quit Maka must have explicit, tested product semantics on each platform.
Acceptance criteria
Cmd+Q/ an equivalent explicit full-quit path retires the exact Desktop-owned ephemeral Host even when a Scheduled Task, Goal, or Automation holds durable residency.result_unknown.Architecture boundaries
Two Draft PRs cover complementary parts of one larger lifecycle problem:
#3254 is not limited to takeover of a “truly idle” incompatible Host: it records a real epoch-24 takeover while a
scheduled-taskresidency existed. That capability is legacy-dependent because the current Host kernel's generation-takeover path requires#isTrueIdle(). The system therefore lacks a stable, forward-compatible management contract for every incompatible durable-resident Host.Neither Draft PR defines the final lifecycle authority. The target architecture is one local Host reconciliation system with one lifecycle owner, one artifact identity, one epoch fence, and one transition state machine shared by Desktop, installed CLI, and TUI presentation adapters.
Non-goals
/exitsemantics (feat(tui): add explicit local Runtime Host lifecycle and upgrade-conflict actions #3245)Part of #3231.
AI assistance disclosure
Codex assisted with investigation and drafting. The evidence covers the #3348 outcome, #3254 behavior, and the
mainquit/retirement paths.简体中文
发生了什么
存在 durable residency 时,用户明确退出 Maka Desktop 后,Desktop 自己拥有的 ephemeral Runtime Host 可能仍然存活。该 Host 会继续持有唯一的 State Root writer,导致后续 Desktop generation 或 compatibility epoch 无法针对同一 State Root 启动。只要 recurring durable work 继续保持 Host 常驻,等待就不会自行收敛;当前 workaround 是由用户定位并手工终止该进程。
预期行为:完整的退出 Maka应当构成对 Desktop 所拥有本地 ephemeral Host 的维护授权。Desktop 应让该精确 Host 安全退场并释放 writer,然后才能完成 clean exit。只关闭一个 Surface 必须保持不同语义,不能停止共享或由 operator 管理的 Host。
这是 #3231 中紧急的本地 Desktop 切片。
如何复现
环境
3f5c4bb08main重新核查实现:1e1c886aeephemeral日志、截图或补充上下文
复现证据
macOS 复现记录包括:
PPID 1,且仍持有 State Root writer;SingletonSocket仍存在;runtime.sqlite/runtime.sqlite-wal仍保持打开;#3231 还包含 Windows 复现:active Scheduled Task 使 epoch 24 Host 保持常驻,epoch 25 Desktop 只能提供等待或取消启动。
已核查的当前实现
before-quit调用closeRuntimeHostDesktop。closeRuntimeHostDesktop调用runtimeHostManager.close()。RuntimeHostDesktopManager.close()只关闭 reconnect lifecycle 和 Client resource,不会请求所拥有本地 Host 退场。prepareForUpdate会调用已认证的host.upgrade.prepare,并等待精确的 adopted Host PID 退出。因此,durable residency 会让明确的 Desktop 退出在 Runtime Host 边界上退化成只断开 Surface。
为什么 #3348 没有修复该问题
#3348 明确没有改变 normal-quit Host survival。评审发现其 registration/PID residue sweep 无法将 PID kill 与已认证 Host 原子绑定,因此删除了该方案;PR 关闭时没有留下功能修复。本 issue 不能重新引入只根据 registration/PID 杀进程的方案。
必需行为
Electron 执行明确的完整应用退出时:
每个平台都必须明确并测试“只关闭窗口”和完整退出 Maka的产品语义。
验收标准
Cmd+Q或等价 full-quit 路径,即使存在 Scheduled Task、Goal 或 Automation durable residency,也会让精确的 Desktop-owned ephemeral Host 退场。result_unknown。架构边界
两个 Draft PR 分别覆盖同一个更大生命周期问题的互补部分:
#3254 并不限于接管“真正空闲”的不兼容 Host:它记录了 epoch 24 Host 仍有
scheduled-taskresidency 时的真实 takeover。该能力依赖 legacy Host 行为,因为当前 Host kernel 的 generation-takeover 路径要求#isTrueIdle()。因此,系统仍缺少一套适用于所有未来不兼容且 durable-resident Host 的稳定管理契约。两个 Draft PR 都没有定义最终 lifecycle authority。目标架构是一套本地 Host reconciliation 系统:由一个 lifecycle owner、一种 artifact identity、一道 epoch fence 和一个 transition state machine 统一支撑 Desktop、installed CLI 与 TUI presentation adapter。
非目标
/exit语义(feat(tui): add explicit local Runtime Host lifecycle and upgrade-conflict actions #3245)属于 #3231。
AI 辅助声明
Codex 协助了调查与起草。证据覆盖 #3348 的最终结果、#3254 的行为,以及
main的退出和 retirement 路径。