From 54bbd4877a44b9e3632753bf367108eb4ee75b25 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 19 Jun 2026 04:28:01 +0000 Subject: [PATCH] fix: remove persistFailure from readiness timeout and gate work on host suspend - Remove backendOutputLog.persistFailure call from onReadinessFailure handler since the backend process is still running during a readiness timeout and failure logs should only be written on actual process exit. - Add hostPower.suspended check to isHostConstrained so background work (scoped and opportunistic) is paused when the host is suspended. --- apps/desktop/src/backend/DesktopBackendManager.ts | 3 --- apps/server/src/background/BackgroundPolicy.ts | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/desktop/src/backend/DesktopBackendManager.ts b/apps/desktop/src/backend/DesktopBackendManager.ts index 94a4f41942..02daef28fe 100644 --- a/apps/desktop/src/backend/DesktopBackendManager.ts +++ b/apps/desktop/src/backend/DesktopBackendManager.ts @@ -541,9 +541,6 @@ const makeDesktopBackendManager = Effect.fn("makeDesktopBackendManager")(functio yield* logBackendManagerWarning("backend readiness check failed during bootstrap", { error: error.message, }); - yield* backendOutputLog.persistFailure({ - details: error.message, - }); }, ), onOutput: (streamName, chunk) => backendOutputLog.writeOutputChunk(streamName, chunk), diff --git a/apps/server/src/background/BackgroundPolicy.ts b/apps/server/src/background/BackgroundPolicy.ts index 1397aed4a8..8f55e4412e 100644 --- a/apps/server/src/background/BackgroundPolicy.ts +++ b/apps/server/src/background/BackgroundPolicy.ts @@ -82,6 +82,7 @@ function isHostConstrained( settings: ResolvedBackgroundActivitySettings, ): boolean { if (hostPower.stale) return false; + if (hostPower.suspended) return true; if ( (settings.pauseWhenHostLocked && hostPower.locked === "true") || hasThermalPressure(hostPower)