Repository navigation
opencode-claimant: hand back the next candidate on cap saturation (#1187) - #12678
Merged
Merged
Conversation
) A live claimant fire that found the session cap saturated only wrote a local fires.jsonl skip record and exited: the waiting candidates stayed queued with nothing on the task or its issue - the silent backlog dispatch v1.1 forbids. The hand-back existed only as prose in the (now disabled) conductor instruction. hand_back_step now runs in the saturated branch of a fire: it targeted-claims the next launchable candidate from the fire-start snapshot, parks it with reason class executor-saturated and the broker's capacity ready-condition (a capacity wait - floored at the capacity scale, budget-bypass eligible when a slot frees), and posts the hand-back agent-note on the candidate's issue. One hand-back per fire; shadow fires mutate nothing; a claim that does not land parks nothing. The fire log records the outcome under its own hand_back key, keeping the cap_saturated skip entry unchanged. Tests: TestHandBackStep (6) over the argv boundary plus the fires entry; the existing cap-exit fire-log test gains the subprocess stub it now needs to stay hermetic. Full hermetic suite: 165 tests OK.
5 tasks
|
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 11 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. |
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. |
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One slice of #1187 (OpenChamber dispatch v1.1): hand-backs as code in the opencode claimant — criterion 2's mechanism.
Component status map for #1187, reconciled against
origin/mainfor this slice:pm-stack/opencode-claimant, #3026) admits launches. Pool half is route-owned: launches go onopencode-route/workhorseand the route owns pool selection/failover; no dispatcher-side POOL MAP gate exists as code.What changed: a live claimant fire that finds the session cap saturated with launchable candidates waiting now hands the next candidate back in the same fire — targeted-claims it (the broker's park verb only parks a task its caller holds), parks it with reason class
executor-saturatedand the broker's capacity ready-condition ({"kind": "capacity"}), and posts the hand-back agent-note on its issue. Before this PR the same fire wrote only a localfires.jsonlskip record and exited, leaving the candidate silently queued — the backlog shape the issue forbids ("Saturation is reported, never a silent backlog").One hand-back per fire; shadow fires mutate nothing; a claim that does not land (or lands on a different row) parks nothing. The fire log keeps its
cap_saturatedskip entry and records the hand-back under a newhand_backkey (theprovider_wallprecedent). No new dependencies.Evidence
Fail-before (on
origin/main, new tests only):python3 -m unittest test_claimant.TestHandBackStep→ 6 tests, 1 failure + 5 errors (nohand_back_step, no hand-back in a saturated fire).Pass-after (this branch, commit
6239d2a87): the claimant's full hermetic suite —including the 6 new
TestHandBackSteptests (oracle: the argv sequence at the subprocess boundary — claim--taskfor the first candidate only, one park carryingexecutor-saturated+ the capacity ready-condition, onegh issue comment— plus thefires.jsonlentry) and the pre-existing cap-exit fire-log test, which gains the subprocess stub it now needs to stay hermetic (its assertions are unchanged).Venue: the suite is hermetic by design (offline, fail-closed I/O guards, all transports stubbed) and ran in the sandbox; no live queue, server, or GitHub state was touched. The live behaviour closes criterion 2's standing check on the first saturated claimant fire that exercises it — per the 2026-11-03 ruling (option B), criteria 2–3 are natural-occurrence standing checks, so the issue's checkbox stays unticked until that occurrence.
Merge Danger
Low. The change is additive inside one step of one script: a new branch in the saturated path of a claimant fire, three new helpers, one new optional
log_firekey. The only behavioural change for existing paths is that a live saturated fire now performs one claim + one park + one issue comment it did not before; shadow mode is byte-identical in behaviour, and every failure mode of the new step degrades to a recorded non-hand-back (the fire still exits 0 with thecap_saturatedskip). Reverting this PR restores the prose-only status quo without touching queue state shape — the capacity ready-condition it writes is the broker's existing, already-shipped wait kind.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.