fix(menubar): manual cadence never respawns from stuck-refresh cleanup

Stale-force or stale-loading recovery could set shouldForceRefresh even
with a nil interval, so Manual mode (and its wake path) still spawned
after a stuck fetch. Cleanup now clears state without respawning unless
the cadence allows auto-spawns; the next user interaction fetches.

Refs #647
This commit is contained in:
AgentSeal 2026-07-09 22:27:44 +02:00
parent b4c04e7beb
commit fd3ec8707c

View file

@ -573,9 +573,12 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSPopoverDelegate {
// and never auto-spawning in Manual (#647).
let interval = currentRefreshInterval()
let intervalElapsed = interval.map { sinceLast >= $0 } ?? false
// Stuck-refresh cleanup may retrigger a spawn only when the cadence
// allows auto-spawns at all: in Manual mode the stale state is
// cleared and the next user interaction fetches fresh.
let recoveryRespawnAllowed = interval != nil
let shouldForceRefresh = forcePayload ||
clearedStaleForceRefresh ||
clearedStaleLoading ||
((clearedStaleForceRefresh || clearedStaleLoading) && recoveryRespawnAllowed) ||
intervalElapsed
if shouldForceRefresh {