Merge remote-tracking branch 'origin/main' into agent/lambda/d4515117

This commit is contained in:
Lambda
2026-08-06 13:31:41 +08:00
2 changed files with 25 additions and 2 deletions

View File

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

View File

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