fix: wait for stale runner lease before replacement claim

This commit is contained in:
Codex
2026-06-03 23:49:40 +08:00
parent 0dfe709fd4
commit 0d040a33c2
3 changed files with 114 additions and 2 deletions
+2
View File
@@ -34,6 +34,8 @@ if (process.env.AGENTRUN_CODEX_ARGS) options.codexArgs = JSON.parse(process.env.
if (process.env.CODEX_HOME) options.codexHome = process.env.CODEX_HOME;
if (process.env.AGENTRUN_RUNNER_IDLE_TIMEOUT_MS) options.idleTimeoutMs = Number(process.env.AGENTRUN_RUNNER_IDLE_TIMEOUT_MS);
if (process.env.AGENTRUN_RUNNER_POLL_INTERVAL_MS) options.pollIntervalMs = Number(process.env.AGENTRUN_RUNNER_POLL_INTERVAL_MS);
if (process.env.AGENTRUN_RUNNER_CLAIM_RETRY_TIMEOUT_MS) options.claimRetryTimeoutMs = Number(process.env.AGENTRUN_RUNNER_CLAIM_RETRY_TIMEOUT_MS);
if (process.env.AGENTRUN_RUNNER_CLAIM_RETRY_INTERVAL_MS) options.claimRetryIntervalMs = Number(process.env.AGENTRUN_RUNNER_CLAIM_RETRY_INTERVAL_MS);
if (process.env.AGENTRUN_RUNNER_ONE_SHOT === "1" || process.env.AGENTRUN_RUNNER_ONE_SHOT === "true") options.oneShot = true;
try {
const result = await runOnce(options);