Skip to content

feat(queue): enforce remaining-budget admission in claim and park #4712

Open

Description

@dezren39

Goal

Implement the contract in the #3418 design record so the queue skips work that cannot fit this shift instead of claiming and parking it on an arbitrary delay.

Design: #3418 (comment)
Implementation surface / ordering: #3418 (comment)

Scope

  • After the design(queue): durable task data model — blocker links, park revalidation, status reasons + notes, full event history, actor provenance #3424 migration-baseline task 6633 verifies the restored chain/live schema, add the next migration for nullable tasks.required_budget_minutes, packet/timebox defaulting, and non-negative validation. Do not assume a migration number from the stale local snapshot.
  • Extend claim_repo_task and repo-queue.py claim to require remaining-budget input and atomically filter on requirement fit without mutating mismatches. Keep not_before as an independent conjunctive gate; no unlimited legacy claim overload.
  • Extend packet schema/enqueue mapping and the helper park interface for explicit budget requirements; pure capacity park must not invent a future not_before.
  • Update pm-stack/dispatch/src/packet.ts / queue.ts if dispatch-produced packets need to emit the effective requirement.
  • Add focused SQL/helper/dispatch tests for the acceptance cases below.

Acceptance

  • Null legacy requirement behaves as before; explicit requirement uses packet timebox_minutes only as its default.
  • Exact fit can claim; one-minute-short skips without claim, status change, or not_before mutation.
  • Pure capacity park is claimable immediately by a fitting worker; external-wait not_before remains unchanged and blocks until due; after due, budget fit is still enforced.
  • 5256-shaped 120/10/120 case passes; priority does not bypass fit; impossible-fit is surfaced rather than skipped forever.
  • Tests and migration number/schema-baseline evidence are posted here; do not change opencode#1014 itself.

Excludes

Activity

  1. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · queued

  2. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor
  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  4. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  5. 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 3, 2026
  6. 256 remaining items

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

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. 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
  10. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  11. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: task 6693
    • Found via: monitor reconciliation
    • Task: Claim-evaporation repair — the queue claim on task 6693 evaporated (the holding run ended without complete/park/block and the lease expired); task 6693 is queued and unclaimed. Labels reset to the truth (queue/queued + status/needs-triage). Checkpoint stage at evaporation: probe_lane_check.
    • Expectation: a queue lane re-claims task 6693 and resumes from the probe_lane_check checkpoint.
  12. added
    queue/queuedHas a queued task in the Supabase agent queue
    and removed
    work/assignedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    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/queuedHas a queued task in the Supabase agent queuesource/creatorFiled by the new-issue-creator jobstatus/needs-triageNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions