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.
This commit is contained in:
Cursor Agent committed 2026-06-19 04:28:01 +00:00
1 parent 4a875dbe51
commit 54bbd4877a
2 files changed
+1 -3

No files matched your search

@@ -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),
@@ -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)