You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode-claimant: restore bind_repo_task_lane_session guarded recovery mode dropped by migration-0023 #5400
Found by Codex review of PR #5399 (comment 4466514775), verified against live state during task 9348 (2026-11-04):
Defect
agent.bind_repo_task_lane_session live today has no guarded recovery branch: the recovery launched_by values (opencode-claimant-recovery:zero-message-deleted, opencode-claimant-recovery:gone-session) from migration-0022.sql are unhandled, and the function rejects expired leases. The claimant prompt (pm-stack/opencode-claimant/prompt.md steps 1c-1d) explicitly invokes those recovery operations after lease expiration, so they raise instead of atomically clearing the bindings — deleted/vanished sessions stay bound and the documented relaunch flow (#4758 recovery rule) cannot run.
Evidence
migration-0022.sql (on main) defines the recovery branch (compare-checks both stores, clears atomically, increments attempts, records launch_failed).
Live overload check 2026-11-04: exactly one bind_repo_task_lane_session(bigint, text, text, text) in the agent schema.
Fix shape
A new claimant migration (next free number after 0024) that merges both behaviors against the current live body: migration-0022 recovery branch + migration-0023 claim guard + migration-0024 lock order (task row FOR UPDATE before ledger access, including in the recovery branch). Exercise in a rolled-back transaction: recovery bind with each reserved launched_by value against an expired-lease task with matching bindings clears both stores and increments attempts; mismatched prior session id is refused.
Acceptance
Recovery calls from prompt.md steps 1c-1d succeed against live for verified-gone / verified-empty-deleted sessions
Normal bind still requires a claimed task with a live lease
Picked up by Lane A shift (attempt 2/6). Revalidated 2026-11-05: issue #5400 is OPEN, no held / user/owned / do-not-merge / do-not-auto-edit labels. This issue is itself about restoring the claimant's guarded recovery mode — the claimant cycling is tracked by issue #5400 and #5016. Execution lane is opencode — handed off to the opencode claimant (repeat handoff: prior park expired unbound). Parking 1800s for the claimant window.
agent-note:v1
task: 10034
lane: code-j
state: handed_off
execution_lane: opencode
note: Re-claimed by lane code-j (attempt 2/6, repeat handoff); issue #5400 verified OPEN with no hard-stop labels via developing.today app token (gh user token rate-limited). Handed off to opencode claimant to launch the bound session; parking 1800s pending claimant launch.
Plan: author migration-0026 merging migration-0022's two reserved recovery modes into the migration-0024 definition (task-row-first locking preserved; normal bind keeps the claimed + live-lease guard). Open detail from triage decided in the migration: recovery requires an expired lease, matching prompt.md, which only invokes recovery after lease expiry.
Focused tests cover both recovery reasons, mismatch refusal (both stores unchanged), live-lease recovery refusal, and the normal live-lease bind.
Lane code-b follow-on flag from task 10895 (PR #8384):
While dispositioning a Codex finding on PR #8384, I verified the live Turso broker's bind verb (pkgs/fleet/crates/fleet-queue/src/turso_queue.rs, verb_bind): it carries the same claimed + live-lease guard as migration-0024 and contains NO recovery branch at all — the reserved opencode-claimant-recovery launched_by values are not handled anywhere in turso_queue.rs. So on the live backend, a claimant recovery call for an expired-lease task fails the guard exactly as it did against migration-0024's PostgreSQL definition.
PR #8384 restores the contract in the PostgreSQL record copy (migration-0026), which is this task's scoped deliverable. The live-broker parity gap — implementing the same two recovery modes in verb_bind — is a separate follow-on that needs its own task/PR (Rust broker change + tests + deploy). Flagging it here so it is not lost; it is not silently folded into task 10895.
Tests: test/test_migration_0026.sh on a scratch Postgres — all 9 scenarios pass, including S9 (recovery, fresh-claim collection, normal bind), added after the Codex P2 on the first head was dispositioned with live-system evidence (reply 4532765344).
Activity
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 5, 2026
agent-note:v1
task: 10034
state: handed_off
lane: code-a (execution lane: opencode)
Picked up by Lane A shift (attempt 2/6). Revalidated 2026-11-05: issue #5400 is OPEN, no held / user/owned / do-not-merge / do-not-auto-edit labels. This issue is itself about restoring the claimant's guarded recovery mode — the claimant cycling is tracked by issue #5400 and #5016. Execution lane is
opencode— handed off to the opencode claimant (repeat handoff: prior park expired unbound). Parking 1800s for the claimant window.dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
opencode, so this task is handed off to the opencode claimant — no direct triage work by this lane. Fresh check on claim: issue opencode-claimant: restore bind_repo_task_lane_session guarded recovery mode dropped by migration-0023 #5400 OPEN, no hard-stop labels.dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
opencode(repeat handoff, attempt 2/6)developing-today commentedon Nov 5, 2026
agent-note:v1
task: 10034
lane: code-j
state: handed_off
execution_lane: opencode
note: Re-claimed by lane code-j (attempt 2/6, repeat handoff); issue #5400 verified OPEN with no hard-stop labels via developing.today app token (gh user token rate-limited). Handed off to opencode claimant to launch the bound session; parking 1800s pending claimant launch.
274 remaining items
dezren39 commentedon Nov 11, 2026
Lane code-b picked up task 10895 (issue #5400) — working it direct this shift.
test(#5400): cover recovery -> fresh claim -> bind sequence; document…
dezren39 commentedon Nov 11, 2026
Lane code-b follow-on flag from task 10895 (PR #8384):
While dispositioning a Codex finding on PR #8384, I verified the live Turso broker's bind verb (pkgs/fleet/crates/fleet-queue/src/turso_queue.rs, verb_bind): it carries the same claimed + live-lease guard as migration-0024 and contains NO recovery branch at all — the reserved opencode-claimant-recovery launched_by values are not handled anywhere in turso_queue.rs. So on the live backend, a claimant recovery call for an expired-lease task fails the guard exactly as it did against migration-0024's PostgreSQL definition.
PR #8384 restores the contract in the PostgreSQL record copy (migration-0026), which is this task's scoped deliverable. The live-broker parity gap — implementing the same two recovery modes in verb_bind — is a separate follow-on that needs its own task/PR (Rust broker change + tests + deploy). Flagging it here so it is not lost; it is not silently folded into task 10895.
dezren39 commentedon Nov 11, 2026
Lane code-b parked task 10895 (issue #5400) — CI wait on PR #8384.
Merge pull request #8384 from developing-today/queue/10895-5400-migra…
dezren39 commentedon Nov 11, 2026
🤖 Agent note · done (fixed_merged) — task 10895 (issue #5400)
bind_repo_task_lane_session(0022 recovery + 0023 claim guard + 0024 task-row-first lock order).