Skip to content

fix: release stalled pre-publication check claims and dispatch retries directly - #4945

Merged
RomneyDa merged 1 commit into
mainfrom
fix/release-check-claim-on-cleanup-stop
Nov 24, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/release-check-claim-on-cleanup-stop

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Problem

A pre-publication check can sit with no progress for over an hour after a single worker fault.

Observed on 2026-11-23 for @openclaw/diffs@2026.11.10-beta.1 (attempt zx7684n23xxjy339hgftb4w6598jscs5):

  1. 2:13 PM PT: recovery created the attempt and dispatched a targeted check run (45277639538). A shard of the scheduled sweep (45274993819) claimed the attempt first, taking the 70-minute package check lease.
  2. 2:18 PM PT: the targeted run found the active claim, claimed nothing (totalClaimed: 0), and exited success.
  3. 2:33 PM PT: the sweep worker hit prepublication_container_cleanup_unconfirmed and stopped. By design it keeps workspace custody (specs/plugin-qualified-runtime.md), but it also never released the claim, so the attempt stayed locked until the lease expired.
  4. After the lease expired: only the scheduled sweep re-claims expired leases. The sweep runs one at a time, so queued sweeps are cancelled and replaced (six in 90 minutes, none started a job), and running sweeps kept dying the same way (45282286026).

Retryable scanner failures have the same gap. They put the attempt back in pending_checks with a 5-minute backoff but never dispatch it again, so they also depend on that sweep.

Solution

  • Add releasePrePublicationChecksClaim, a worker action gated by the worker token and releasePrePublicationChecksClaimInternal. For the exact claim only, it shortens the lease to the existing 5-minute retry backoff, records why, and schedules a targeted dispatch for when the backoff ends. It doesn't change status or checkFailureCount, so a cleanup fault still isn't treated as the plugin's scan failure and sends no failure email.
  • When cleanup is unconfirmed, the worker calls this action (best effort, with a warning if it fails) before returning workerMustStop. Workspace custody and the stop are unchanged.
  • Retryable scanner failures now also schedule a targeted dispatch after the backoff.
  • requestPublishAttemptDispatch takes an optional delay.
  • The spec paragraph is updated to match.

Evidence

  • New and updated tests fail without the source change: the worker release call, the release-into-backoff path (no failure count, schedules a dispatch), ignoring a stale claim owner, and the retry dispatch after a scanner failure.
  • convex/publishAttempts.test.ts, convex/publishAttemptDispatch.test.ts and scripts/security/run-prepublication-worker.test.ts pass (113 tests), as do the recovery and template runtime suites.
  • tsc --noEmit and oxfmt are clean. The two oxlint no-unnecessary-type-conversion errors in run-prepublication-worker.ts (lines 773 and 886) exist on main.
  • When the whole scripts/security suite runs in parallel, some ClawScan diagnostic, SkillSpector and installation tests fail locally. The diagnostic and SkillSpector files fail the same way on main, and the rest pass when run alone, both on main and with this change.

Not addressed here:

  • Why ClawScan Docker cleanup goes unconfirmed. It was seen repeatedly on 2026-11-23, including after a likely 15-minute ClawScan timeout on diffs.
  • The same missing re-dispatch in backoffFailedPrePublicationHandoffInternal.

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clawhub Ready Ready Preview Nov 24, 2026 1:13am UTC

Request Review

@clawsweeper

clawsweeper Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

This branch was successfully deployed

1 active deployment
Preview – clawhub — 9ca3b34c Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant