GeezerVison is showing github.com — repo-queue: claim lease dies ~15 min after a 45 min claim; claimed task leaves claim state without a heartbeat/park · Issue #7617 · developing-today/code
repo-queue: claim lease dies ~15 min after a 45 min claim; claimed task leaves claim state without a heartbeat/park #7617DescriptionWhat happened
A queue claim was accepted with a 45-minute lease, then silently disappeared ~15 minutes later, so every subsequent checkpoint/heartbeat/complete for that task returned task 11049 is not claimed by repo-worker-code and the worker had to finish through the GitHub fallback path.
Timeline (all 2026-11-08Z):
09:40:06 — repo-queue claim --queue repo-health-code-pilot --worker repo-worker-code --lease-seconds 2700 --lane 9aca43b4-... returned task 11049 with "lease_until": "2026-11-08T10:25:06Z" and "lane_id": "code-z" (the passed lane id was not stored).
09:40:20 — repo-queue checkpoint 11049 --worker repo-worker-code --stage claimed succeeded.
09:57 — repo-queue checkpoint ... --stage triaged failed: not claimed by repo-worker-code; heartbeat 11049 failed the same way; repo-queue list --status claimed --limit 500 no longer lists it.
- The task was still not claimable afterwards: a new
claim returned a different, older-by-priority task (11972) instead of 11049.
Why this matters
The lease the caller asked for and the lease the row reported (10:25:06) does not match when the claim actually died (~09:55, i.e. ~900 s = the helper's default --extend-seconds/heartbeat window). A worker that trusts the reported lease_until will lose its claim mid-task and, as here, be forced onto the GitHub fallback for its closing verbs — the exact "claimed-then-abandoned" shape the anti-evaporation discipline exists to prevent.
Hypothesis
Either (a) claim stores lease_until from --lease-seconds but the reaper / claim validity check uses claimed_at + 900 s, or (b) the leases table row is written with the default 900 s while tasks.lease_until keeps 2700 s, so the two disagree.
To check
agent.tasks vs leases rows for task 11049 (worker repo-worker-code) on 2026-11-08.
- The claim RPC's
lease_seconds handling vs expire_leases / heartbeat_task lease checks.
Note: "lane_id": "code-z" on the claim, despite --lane 9aca43b4-5439-4939-9f71-323f5d32521b, may be the same class of "requested value not honoured" defect.
Acceptance criteria
- A claim taken with --lease-seconds 2700 remains claimed for the full lease: checkpoint, heartbeat, and complete by the claiming worker succeed at any point before lease_until.
- The lane_id passed at claim is the lane_id stored on the task row (the 2026-11-08 claim stored a different lane than the one passed).
- A regression test or broker-level check pins lease duration + lane storage, so a silent ~900s claim death recurs detectably, not silently.
Activitydeveloping-today commented on Nov 8, 2026 developing-today commented on Nov 8, 2026 Additional data points from lane code-x (2026-11-08, all UTC):
- task 10502 (issue id: design: DoS scenario catalogue per interface (from #5685) #5892, triage, assigned_lane=opencode): claimed ~09:56 with --lease-seconds 2700 (lease_until 10:41), checkpoint stage=claimed succeeded, then the handed_off checkpoint and park ~1 minute later both returned "task 10502 is not claimed by repo-worker-code" (broker exit 5).
- task 11993 (issue mcpx docs: level 3 -- the compendium, release markers and section history (tracker) #1907, triage, assigned_lane=opencode): same shape minutes later — claim + claimed checkpoint OK at ~10:07, handed_off checkpoint + park at ~10:08 returned the same verdict.
- Previous lane code-x shift (~08:56Z) recorded the identical verdict on task 12186 (issue queue: repo-queue.py resolves two different Supabase projects across processes — fleet queue reads/writes split-brain #4903) and task 11977 (issue Event store: one table for every statistic, from any source #1850), in its handoff snapshot.
Difference from the task 11049 timeline in the issue body: these claims died in ~1-2 minutes, not ~15, and all four code-x cases were opencode-assigned tasks between the claimed checkpoint and the handed_off checkpoint. Two candidate mechanisms to check alongside the 900s-lease hypothesis: (1) the opencode claimant (or another holder) takes/binds the task in that window and changes worker_id, so the verdict is the handoff racing the workers park; (2) an even shorter validity window on some claim path. Either way the worker-visible contract is broken the same way: a claim that reports a 45-minute lease can be gone before the first work checkpoint after pickup.
Handling on the worker side (per runbook §4 verdict rule): work stopped, agent notes posted on issue #5892 (comments 6720030845, 6720035201) and issue #1907 (comments 6720066776, 6720070945), labels left in the parked set. developing-today commented on Nov 8, 2026 Intake review
Related: Filed by Drew from the task 11049 incident this morning (claim 09:40:06Z with lease_until 10:25:06Z; claim state gone by ~09:57, checkpoint/heartbeat returning 'not claimed by repo-worker-code'). Sibling claim-state issue: #7598 (claim returns tasks stamped with a foreign lane_id), from the same intake batch. Intake search: 0 merged PRs reference this issue - still live.
Notes: This is the claim-evaporation failure family at the broker layer: the row reported a 45-minute lease while the claim died at ~900s, and the passed lane id was not stored. It undermines every lane's checkpoint discipline, hence priority/high.
Risks: The fix touches the claim path every lane depends on; a wrong change here stalls the fleet - broker change must ship with the regression check in the same PR.
Suggested approach: Read the broker's claim/lease code for the TTL actually applied vs the one reported (900s constant suspicion), and for where lane assignment overwrites the passed lane; fix both, with tests.
Labels normalized at intake: status/needs-triage, priority/high, effort/m, source/human, meta/enriched added (existing labels preserved). Acceptance criteria appended to the body (original text preserved verbatim above).
— fleet monitor, intake pass 2026-11-08 (06:12 CST run) developing-today commented on Nov 8, 2026 🤖 Agent note · handed off
developing-today commented on Nov 9, 2026 🤖 Agent note · picked up (direct)
developing-today commented on Nov 9, 2026 🤖 Agent note · done — fixed and merged in PR #7882
- Agent: repo queue worker, lane code-u (repo-worker-code)
- Session / ID: cron repo-queue-worker-shift-u run 2026-11-08 18:24 CST; task 14226
- Found via: queue claim · task 14226 (execution lane: direct, row 5246)
- Root cause named:
verb_claim claimed via a subquery and re-read the result as the newest claimed row for (queue, worker_id). All lanes share worker_id repo-worker-code, so concurrent claims could return another lane's just-claimed task — live repro this shift: lane code-u claims returned task 13384 stamped lane code-e and task 8500 stamped lane code-t. The caller then works a task it does not own (and the claim guard could quarantine a live foreign claim), which is how a live claim gets displaced mid-work (task 11049 family).
- Fix (PR fix(fleet-queue): claim by explicit id; pin claim lease + lane storage (#7617) #7882, merged 3674ded): claim picks the candidate id first, claims THAT row with a conditional UPDATE by id that re-checks full pick eligibility (status, attempts cap, not_before) at claim instant, and reads the row back by id. Claim lease and heartbeat defaults are now named constants (
CLAIM_DEFAULT_LEASE_SECONDS=2700 vs HEARTBEAT_DEFAULT_EXTEND_SECONDS=900) with claim_lease_until() as the single source for the stored lease_until.
- Tests (oracle: this issue's acceptance): new
claim_lease_is_the_requested_lease_not_the_heartbeat_default and claim_lane_argument_is_stored_verbatim; cargo test -p fleet-queue --features queue-broker --lib claim_ → 10 passed; full turso_queue suite 20 passed (laptop). PR checks were QUEUED at merge time (fleet CI stall); merged under standing merge authority on the laptop test verification. Note: the broker binary must be rebuilt/redeployed from main for the fix to go live — merging alone does not restart the running broker.
- Links: task 14226 · issue repo-queue: claim lease dies ~15 min after a 45 min claim; claimed task leaves claim state without a heartbeat/park #7617 · PR fix(fleet-queue): claim by explicit id; pin claim lease + lane storage (#7617) #7882 · sibling queue: claim returns tasks stamped with a foreign lane_id — and other lanes' live claims carry mine (attribution inverted both ways) #7598
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|