Repository navigation
fleet queue: batch claim + per-item dispatch (#8217) - #8244
Conversation
) Broker: claim gains count (BATCH_CLAIM_MAX=5) — verb_claim_batch runs the extracted claim_pick_once N times behind one claim_preamble; a single claim is one preamble + one pick, byte-equivalent flow. The pick (candidate SELECT + atomic claim UPDATE) and plain claim_by_id now enforce a recorded platform limitation + reason from the lane ledger (#8210 mechanism): cross-family claims skip limited rows; a reason-less stored limit is cleared, never enforced. New /release verb: holder-only, reason required, returns the row to queued immediately (lease + binding cleared, attempts unchanged, released audit event). Client: claim --count (cap checked locally), batch output with the #6741 fallback guard applied per row, and the release verb. Claimant: dispatch_batch.py — one batch claim + per-item dedicated sub-task dispatch (opencode via send_to_opencode.send, Muse via lane-spawned sub-session + --bind), every bind verified from live queue state, failures released to queued (--release-failures) or held by the lane direct, never claimed-idle. Tests: fleet-queue 161 lib + 2 integration green; claimant suites 126 green (9 new dispatch tests).
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Implements #8217 (batch claim + per-item dedicated sub-task dispatch), on top of #8187 (single-session redesign) and #8210/#8223 (send + transfer). Drew's rules bind: batch dispatch is a stated mode with the reason recorded per item; a platform limitation exists only with a good reason recorded; no claimed-and-idle states.
Broker (
turso_queue.rs)claimgainscount: absent/1 = the existing single claim (the pick was extracted verbatim intoclaim_pick_oncebehindclaim_preamble; a single claim is one preamble + one pick).count2..=5 (BATCH_CLAIM_MAX) runs the identical atomic pick that many times and returns{"rows": [...], "claimed": k, "requested": n}— same eligibility, priority/age order, attempts/lease semantics, per-item claimed events and marks. Partial batches are normal.count+task_idis a usage error (by-id/transfer claims stay single).claim_by_idenforces the same rule, and a reason-less stored limit is cleared rather than enforced. Family-less claims are served only unlimited rows./releaseverb: holder-only, reason required; returns a claimed row toqueuedimmediately — worker/lease/wait fields and the session binding cleared, attempts unchanged, lease row deleted,releasedaudit event with the reason and the claim's marks.Client (
client.rs)claim --count N(cap enforced locally too), batch verdict{"tasks": [...], "claimed": k, "requested": n, "guard_held": [...]}with the Turso replacement for the queue core: dedicated muse-queue DB + fleet queue-broker Turso backend #6741 fallback guard and payload defense applied per row; zero served = the usual no-claim exit 5.release <task> --worker <w> --reason <text>.Claimant (
pm-stack/opencode-claimant/dispatch_batch.py)One call runs the mode: batch-claim declaring the target family, then per item — its own worktree (
~/git/fleet/queue-<task>-<issue>-dispatch), opencode viasend_to_opencode.send()(the #8210 launcher, reused whole) or Muse via lane-direct + dispatch checkpoint +--bind <task>:<session>for the lane-spawned sub-session — then verify every bind from live queue state. Failures: released straight back to queued with--release-failures, else held by the lane direct; a Muse item without--bindreportsprepared_unboundand fails the batch. One JSON record per item.Tests
cargo test -p fleet-queue --all-features) — new: cap/parse truth table, batch shape + order, pick-repetition oracle, limitation clause shape + placeholder bindings, by-id limitation oracle, release contract oracle, client--countbounds.Runbook: §1d "Dispatch mode" added to the lane instruction (serial stays the default; dispatch is an allowed stated mode).
Live acceptance receipts are posted on #8217 (batch order proof, limitation exclusion/inclusion, opencode dispatch with distinct sessions/worktrees, forced bind failure returning to queued).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.