Repository navigation
Conversation
…fire (#1187) A saturated claimant fire logged cap_saturated and exited with the waiting candidate still queued and nothing recorded but the fire log. It now hands back the next candidate within the round: claim --task as the claimant (park requires a live claim), park with reason executor-saturated as a capacity wait (1h floor, capacity bypass lets an urgent lane reclaim sooner), and note it on the issue. One hand-back per fire; shadow fires record shadow_would_hand_back and mutate nothing. Tests: 8 new TestHandBack cases; the #8038 cap-exit test now pins the hand-back skip. Hermetic suite 168/168; CI python suites green.
Codex Review Summary: ✅ CompletedThis 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. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c4d44c983
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| claimed_id = ( | ||
| claim_data.get("id") if isinstance(claim_data, dict) else None | ||
| ) | ||
| if claim_result is None or claim_result.returncode != 0 or claimed_id != task_id: |
There was a problem hiding this comment.
Stop the pass after an indeterminate claim result
If a claim commits but the subprocess times out before returning its response, the exception is treated as an ordinary claim refusal and the loop proceeds to another candidate. A successful claim with malformed output has the same outcome. This can leave multiple tasks claimed without parking or launching any of them, making them unavailable until their leases expire. Unlike an explicit refusal, an indeterminate result should stop the pass or reconcile ownership before proceeding; the existing _collect_handed_offs also stops on exceptions.
Useful? React with 👍 / 👎.
| stopped = True | ||
| continue | ||
| packet = candidate.get("packet", {}) | ||
| note_posted = _post_hand_back_note(task_id, candidate, packet, cap_room) |
There was a problem hiding this comment.
Deduplicate capacity-park notes before posting
When a task is handed off again while the executor remains saturated, this path unconditionally posts another capacity-park comment for the same task. There is no prior-note check, and the new state=handed-back header is outside the lane guard's parked/picked-up deduplication states. Repeated saturation cycles can therefore produce repeated issue notifications without a meaningful progress transition. Check the existing notes using the documented lane-guard contract and use its parked-note header before posting.
AGENTS.md reference: AGENTS.md:L92-L94
Useful? React with 👍 / 👎.
| "--platform", | ||
| "openchamber", | ||
| ], |
There was a problem hiding this comment.
Include the claimant's model stamp in hand-back claims
For a sink candidate with payload.requires.model matching workhorse or opencode-route/workhorse, this claim always fails because it supplies neither model flags nor a session from which the CLI can derive them. The normal _collect_handed_offs path supplies LAUNCH_MODEL_PROVIDER and LAUNCH_MODEL_ID, so the same task is launchable when capacity exists but cannot be handed back when saturated. The CLI help declares [--model-provider <p>] [--model-id <id>] (pkgs/fleet/crates/fleet-queue/src/client/support.rs:236), and task_requirements_unmet explicitly rejects model-requiring tasks when the claim has no model. Pass the same model stamp here so these eligible candidates can be parked and noted rather than repeatedly skipped.
AGENTS.md reference: AGENTS.md:L80-L83
Useful? React with 👍 / 👎.
|
Closing as a duplicate of #12678 (merged 2026-11-22T20:52Z), which landed the same #1187 hand-back step: targeted claim of the next candidate on a saturated fire, park as executor-saturated under the capacity ready-condition, and the hand-back agent-note on the issue. Flagged during the #1234 reconciliation (2026-11-22) and dispositioned by agent felix. No unique content lost — the hand-back behaviour is on main via #12678, verified by its hermetic suite (165 tests OK at merge, 203 with today's babysitter + nudge slices). |
Summary
#1187 criterion 2 (hand-back at capacity) had no code behind it: a saturated claimant fire logged one
{"reason": "cap_saturated"}skip and exited, leaving the waiting candidate queued with nothing recorded but the fire log. This slice implements the hand-back inpm-stack/opencode-claimant/claimant.py:_firestep 3 now callshand_back_next_candidate(...)instead of logging the bare skip.claim --task, the Dispatcher v1 live: scheduled launches of OpenCode/OpenChamber sessions for queued issues #1337/Routing policy alignment: map OpenChamber routing categories to the fleet's Workhorse-first tiers + POOL MAP gates #1272 verb — park requires a live claim by the parking worker), parks it with reasonexecutor-saturatedas a{"kind": "capacity"}wait (3600s; the broker floors capacity waits to 1h per fix(queue): broker-owned waits — claim eligibility, wait TTL floors, no attempt burn on bookkeeping cycles #8184, and an urgent lane can still reclaim sooner via the design(queue): budget-aware claiming — parks carry a minimum required time budget, claim matches the claimer's remaining shift budget #3418 capacity bypass), and posts theexecutor-saturatedagent note on the issue.cap_saturatedskips. Shadow fires recordshadow_would_hand_backand mutate nothing. Claim failures try the next candidate; a park failure stops the pass and recordshand_back_park_failedwithclaim_held: true(the claim lapses back to the handoff sink at +0 attempts, fix(queue): handoff sink gets its own status (handed_off) and the fake expiry timer is deleted #8234). Mid-work candidates (any stage other than handed_off/launch_failed) are never taken over, and supervision-recovered tasks are excluded this fire.Evidence
Before (test fails on origin/main):
python3 -m unittest test.test_claimant.TestHandBack→ 8 errors,AttributeError: module 'claimant' has no attribute 'hand_back_next_candidate'.After (this branch, sandbox, pure Python — no Rust build involved):
python3 -I run_hermetic_tests.py→ Ran 168 tests, OK (8 new TestHandBack cases; the opencode-claimant: slice-1 fire implementation diverges from packet spec (supervision selection, hard-rule labels, audit fields) #8038 cap-exit test updated to pin the hand-back skip).python3 -m unitteston test_poll.py (95 OK), test_claimant.py (44 OK), test/test_claimant.py (18 OK), grist discovery (27 OK), launch_one/send_to_opencode/dispatch_batch (27 OK).handed_back_executor_saturatedplus the parked task and its issue note.Merge Danger
hand_back_park_failed); the task returns to the handoff sink, no attempt burned.Refs #1187 (criterion 2 mechanism; the box stays unticked until a live saturated fire proves it).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit