diff --git a/server/internal/daemon/agents_refresh.go b/server/internal/daemon/agents_refresh.go index b58100c0f0..9594249d3e 100644 --- a/server/internal/daemon/agents_refresh.go +++ b/server/internal/daemon/agents_refresh.go @@ -27,7 +27,20 @@ var agentConvergeMaxBackoff = 30 * time.Minute // of codex/claude is picked up without a restart. A round is one `--version` // fork per installed CLI, fanned out and machine-level — it does not scale with // workspace count or runtime count. Overridable for tests. -var agentVersionRefreshInterval = 5 * time.Minute +// +// This is the one local probe whose cost grows with the host (one fork per +// installed CLI) and which executes third-party binaries, some of whose +// wrappers have visible side effects when run — so it is the one worth +// lengthening if background probing needs to get cheaper. +// +// It is not lengthened further than selfReloadCheckInterval, though, because +// the round does more than refresh a displayed version string: it also keys +// version-sensitive launch policy, and it is what confirms a CLI has dropped +// below its minimum supported version and must stop being given work. The +// interval is therefore also the window in which an unsupported CLI keeps +// claiming tasks, which is why this tracks the reload check rather than being +// pushed out on cost grounds alone. +var agentVersionRefreshInterval = 10 * time.Minute // agentDiscoveryLoop keeps the registered runtime set converged on the agent // CLIs actually installed on this machine, so a CLI installed while the daemon diff --git a/server/internal/daemon/auto_update.go b/server/internal/daemon/auto_update.go index 40b1c22044..646e4e2e14 100644 --- a/server/internal/daemon/auto_update.go +++ b/server/internal/daemon/auto_update.go @@ -73,7 +73,17 @@ var autoUpdateInitialDelay = 2 * time.Minute // re-exec. One fork/exec per tick, machine-level (not per workspace, not per // runtime), so the cost is fixed no matter how big the daemon's workload is. // Overridable for tests. -var selfReloadCheckInterval = 5 * time.Minute +// +// The value bounds how long a user waits after replacing the binary themselves, +// not how often we ship: the "is there a new release" question belongs to +// DefaultAutoUpdateCheckInterval, and only that one should track release +// cadence. It also compounds, because a tick that lands while the daemon is +// busy defers to the next one rather than interrupting a task — so the wait is +// really "the first tick that is both due and idle". Ten minutes keeps the +// average wait around five and the multiplier tolerable on a busy host; an hour +// would not, and would put us back in sight of the "I upgraded and nothing +// happened" problem this check exists to remove. +var selfReloadCheckInterval = 10 * time.Minute // selfReloadProbeTimeout bounds the `--version` fork/exec. Generous: the point // of the timeout is to stop a wedged binary from parking the loop goroutine,