Skip to content

The agent that grows with you

fix(desktop): keep startHermes inert without the single-instance lock

YappLeCuntdf899956749c
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index fd72f710d77..483a80ca830 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -9673,6 +9673,15 @@ async function prepareProfileDeleteRequest(request) {
}
async function startHermes() {
+ // Only the single-instance lock holder may reap/spawn/claim the desktop
+ // backend. A lock-losing instance must stay inert even if some path reaches
+ // here (e.g. the deferred-quit window before `ready`): its reapOrphans()
+ // otherwise SIGTERMs the running instance's live backend (#87295).
+ if (!isPrimaryInstance) {
+ rememberLog('[boot] non-primary instance: skipping backend machinery')
+ throw new Error('Hermes Desktop is already running in another window.')
+ }
+
await reapOrphanedBackendsOnce()
// Latched-failure short-circuit: once bootstrap has failed in this