From daeb0cd4f65148c1db0b5bc0f140c8508509492d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 20 Jul 2026 17:48:49 -0700 Subject: [PATCH 1/2] fix(repair): let apply-lane publishers out-wait state lease contention --- .github/workflows/sweep.yml | 6 ++++++ src/repair/git-publish.ts | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sweep.yml b/.github/workflows/sweep.yml index 0554e21bf7..2197711058 100644 --- a/.github/workflows/sweep.yml +++ b/.github/workflows/sweep.yml @@ -3959,6 +3959,8 @@ jobs: apply-proof: name: Prove close coverage without write credentials + env: + CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" if: ${{ ((github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing == 'true') || (github.event_name == 'schedule' && (github.event.schedule == '3 * * * *' || github.event.schedule == '18 * * * *' || github.event.schedule == '33 * * * *' || github.event.schedule == '48 * * * *' || github.event.schedule == '8,23,38,53 * * * *' || github.event.schedule == '6,21,36,51 * * * *'))) && !(github.event_name == 'repository_dispatch' && github.event.client_payload.target_repo == 'openclaw/clawhub' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') && !(github.event_name == 'schedule' && github.event.schedule == '8,23,38,53 * * * *' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') }} runs-on: ubuntu-latest timeout-minutes: 60 @@ -4183,6 +4185,8 @@ jobs: publish-apply-proof-action-ledger: name: Publish immutable apply proof action ledger + env: + CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" needs: apply-proof if: ${{ always() && needs.apply-proof.result != 'skipped' }} runs-on: ubuntu-latest @@ -4254,6 +4258,8 @@ jobs: apply-existing: name: Apply close proposals + env: + CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" needs: [apply-proof, publish-apply-proof-action-ledger] if: ${{ always() && !cancelled() && needs.apply-proof.outputs.proof_ready == 'true' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing == 'true') || (github.event_name == 'schedule' && (github.event.schedule == '3 * * * *' || github.event.schedule == '18 * * * *' || github.event.schedule == '33 * * * *' || github.event.schedule == '48 * * * *' || github.event.schedule == '8,23,38,53 * * * *' || github.event.schedule == '6,21,36,51 * * * *'))) && !(github.event_name == 'repository_dispatch' && github.event.client_payload.target_repo == 'openclaw/clawhub' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') && !(github.event_name == 'schedule' && github.event.schedule == '8,23,38,53 * * * *' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') }} runs-on: ubuntu-latest diff --git a/src/repair/git-publish.ts b/src/repair/git-publish.ts index 5b3bc917d4..78bc1c6aff 100644 --- a/src/repair/git-publish.ts +++ b/src/repair/git-publish.ts @@ -85,7 +85,17 @@ const RECOVERY_FETCH_TIMEOUT_MS = 300_000; const STATE_PUBLISH_LEASE_REF_ROOT = "refs/heads/clawsweeper-publish-lease"; const STATE_PUBLISH_LEASE_TTL_MS = 2 * 60_000; const STATE_PUBLISH_LEASE_RENEW_THRESHOLD_MS = PUBLISH_FETCH_TIMEOUT_MS; -const STATE_PUBLISH_LEASE_ACQUIRE_TIMEOUT_MS = 3 * 60_000; +const STATE_PUBLISH_LEASE_ACQUIRE_TIMEOUT_MS = (() => { + const fallback = 3 * 60_000; + // Rare, high-value publishers (the apply lane) starve behind the review + // herd inside the default window; their workflows may raise the budget so + // one apply publish out-waits contention instead of failing the run. + const configured = Number(process.env.CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS); + if (Number.isInteger(configured) && configured > fallback) { + return Math.min(configured, 30 * 60_000); + } + return fallback; +})(); const STATE_PUBLISH_LEASE_WAIT_MS = 1_000; const STATE_PUBLISH_LEASE_MAX_WAIT_MS = 5_000; const SKIP_CI_DIRECTIVE_PATTERN = From daa70adfb324e983fc6f52c48daee7a47e8efcd7 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 20 Jul 2026 17:52:05 -0700 Subject: [PATCH 2/2] fix(workflow): dedupe apply-lane lease env blocks --- .github/workflows/sweep.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sweep.yml b/.github/workflows/sweep.yml index 2197711058..1da62c7740 100644 --- a/.github/workflows/sweep.yml +++ b/.github/workflows/sweep.yml @@ -3959,8 +3959,6 @@ jobs: apply-proof: name: Prove close coverage without write credentials - env: - CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" if: ${{ ((github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing == 'true') || (github.event_name == 'schedule' && (github.event.schedule == '3 * * * *' || github.event.schedule == '18 * * * *' || github.event.schedule == '33 * * * *' || github.event.schedule == '48 * * * *' || github.event.schedule == '8,23,38,53 * * * *' || github.event.schedule == '6,21,36,51 * * * *'))) && !(github.event_name == 'repository_dispatch' && github.event.client_payload.target_repo == 'openclaw/clawhub' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') && !(github.event_name == 'schedule' && github.event.schedule == '8,23,38,53 * * * *' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') }} runs-on: ubuntu-latest timeout-minutes: 60 @@ -3970,6 +3968,7 @@ jobs: issues: read pull-requests: read env: + CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" CLAWSWEEPER_UNCONFIRMED_PRODUCT_DIRECTION_CLOSE_ENABLED: ${{ vars.CLAWSWEEPER_UNCONFIRMED_PRODUCT_DIRECTION_CLOSE_ENABLED || 'false' }} CLAWSWEEPER_UNSPONSORED_FEATURE_CLOSE_ENABLED: ${{ vars.CLAWSWEEPER_UNSPONSORED_FEATURE_CLOSE_ENABLED || 'false' }} CLAWSWEEPER_IDEA_REVIVAL_REACTIONS: ${{ vars.CLAWSWEEPER_IDEA_REVIVAL_REACTIONS || '5' }} @@ -4258,8 +4257,6 @@ jobs: apply-existing: name: Apply close proposals - env: - CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" needs: [apply-proof, publish-apply-proof-action-ledger] if: ${{ always() && !cancelled() && needs.apply-proof.outputs.proof_ready == 'true' && ((github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing == 'true') || (github.event_name == 'schedule' && (github.event.schedule == '3 * * * *' || github.event.schedule == '18 * * * *' || github.event.schedule == '33 * * * *' || github.event.schedule == '48 * * * *' || github.event.schedule == '8,23,38,53 * * * *' || github.event.schedule == '6,21,36,51 * * * *'))) && !(github.event_name == 'repository_dispatch' && github.event.client_payload.target_repo == 'openclaw/clawhub' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') && !(github.event_name == 'schedule' && github.event.schedule == '8,23,38,53 * * * *' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') }} runs-on: ubuntu-latest @@ -4269,6 +4266,7 @@ jobs: cancel-in-progress: false queue: max env: + CLAWSWEEPER_STATE_LEASE_ACQUIRE_TIMEOUT_MS: "900000" CLAWSWEEPER_UNCONFIRMED_PRODUCT_DIRECTION_CLOSE_ENABLED: ${{ vars.CLAWSWEEPER_UNCONFIRMED_PRODUCT_DIRECTION_CLOSE_ENABLED || 'false' }} CLAWSWEEPER_UNSPONSORED_FEATURE_CLOSE_ENABLED: ${{ vars.CLAWSWEEPER_UNSPONSORED_FEATURE_CLOSE_ENABLED || 'false' }} CLAWSWEEPER_IDEA_REVIVAL_REACTIONS: ${{ vars.CLAWSWEEPER_IDEA_REVIVAL_REACTIONS || '5' }}