Skip to content

opencode-claimant: restore bind_repo_task_lane_session guarded recovery mode dropped by migration-0023 #5400

Open

Description

@dezren39

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

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
  • Lock order stays task-row-first in every branch
  • Record copy lands via PR referencing this issue

Activity

  1. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 5, 2026
  2. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  3. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    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.

  5. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  6. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  7. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor

    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.

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 5, 2026
  9. 122 remaining items

  10. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  11. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 6, 2026
  12. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  13. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  14. added
    queue/claimedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    queue/claimedQueue worker lifecycle state
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

queue/parkedQueue task is parked (waiting on CI, time, or an event)status/parkedDeliberately paused with a recorded resume conditiontask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions