GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(opencode-claimant): hand back the next candidate on a saturated fire (#1187) by dezren39 · Pull Request #12681 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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 in pm-stack/opencode-claimant/claimant.py:

  • _fire step 3 now calls hand_back_next_candidate(...) instead of logging the bare skip.
  • The hand-back claims the next candidate by id (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 reason executor-saturated as 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 the executor-saturated agent note on the issue.
  • One hand-back per fire; remaining candidates are recorded as cap_saturated skips. Shadow fires record shadow_would_hand_back and mutate nothing. Claim failures try the next candidate; a park failure stops the pass and records hand_back_park_failed with claim_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).
  • CI equivalents: python3 -m unittest on 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).
  • Not verified live: no saturated fire has run against this code yet. Live proof is the next saturated claimant fire's fires.jsonl entry showing handed_back_executor_saturated plus the parked task and its issue note.

Merge Danger

  • Behavior change on live fires: the first saturated fire after deploy will claim+park one waiting candidate per fire (max one per 10-min fire) and post one issue note per hand-back. The park is a 1h capacity wait; the task returns to eligibility automatically, and urgent lanes can reclaim sooner via the capacity bypass.
  • If the park fails after a successful claim, the claimant holds the claim until the lease lapses (recorded as hand_back_park_failed); the task returns to the handoff sink, no attempt burned.
  • Mid-loop cap exhaustion inside launch_step is NOT handed back by this slice — only the fire-start saturated branch. That is the named next slice.

Refs #1187 (criterion 2 mechanism; the box stays unticked until a live saturated fire proves it).


Run Proof on this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • New Features
    • When executor capacity is full, the system can now return one eligible unbound task to a capacity-wait state, with a one-hour retry delay.
    • If a candidate cannot be claimed, the system tries the next eligible candidate. It stops if parking a claimed task fails.
    • Shadow mode records which candidate would be returned without changing task state. Issue notes are posted when possible; a note-posting failure does not prevent the hand-back.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
feat(opencode-claimant): hand back the next candidate on a saturated …
5c4d44c
…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.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 21:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T21:08:39.470978Z 5c4d44c PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When capacity is exhausted, the claimant now evaluates eligible unbound OpenCode candidates and can claim and park one as an executor-saturated capacity wait. Shadow mode records a would-hand-back result without mutation. The fire log records candidate outcomes, and launch and hand-back issue notes use a shared target resolver.

Changes: Capacity hand-back

Layer / File(s) Summary
Shared issue-note delivery
pm-stack/opencode-claimant/claimant.py
Launch and hand-back notes use a shared issue-target resolver and comment-posting helper. The hand-back note includes active-root count and capacity timing details.
Candidate selection and capacity parking
pm-stack/opencode-claimant/claimant.py, pm-stack/opencode-claimant/test/test_claimant.py, pm-stack/opencode-claimant/test_claimant.py
At zero capacity, the claimant filters candidates, tries claims in order, and parks at most one successful claim with a one-hour capacity wait. Shadow mode does not mutate candidates. Tests cover claim and park failures, exclusions, note-posting failure, and fire-log output.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Fire as _fire
  participant HandBack as hand_back_next_candidate
  participant Queue as Queue CLI
  participant GitHub as gh
  Fire->>HandBack: candidates and recovered-task exclusions
  HandBack->>Queue: claim eligible candidate by ID
  Queue-->>HandBack: claim result
  HandBack->>Queue: park claimed task with capacity wait
  Queue-->>HandBack: park result
  HandBack->>GitHub: post issue note after successful park
Loading

Possibly related issues

  • opencode-claimant: handed-off tasks are never launched — executed_lane/session_id stay null across repeated claim→handed_off→park cycles #6533 — The issue describes handed-off tasks cycling through claim and park without launch. This change uses the claim-and-park path for saturated-capacity hand-back, but does not show that the reported missing-launch behavior is fixed.

Suggested reviewers: claude

Merge Risk: Minimal · up to 5c4d4

When capacity is exhausted, the claimant can now park one waiting candidate per fire as an executor-saturated capacity wait and post an issue note. No concrete defect was established in the reviewed change. The one remaining caveat is that live behavior on a saturated fire has not yet been observed, so check the first fires.jsonl hand-back entry after deploying.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the feature (hand back the next candidate on a saturated fire) and the component (opencode-claimant), which matches the main change: the new saturated-fire hand-back path in claimant.p…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the feature (hand back the next candidate on a saturated fire) and the component (opencode-claimant), which matches the main change: the new saturated-fire hand-back path in claimant.py, its helper, and the tests. It also includes the PR number (#1187), which is acceptable. The title is one sentence, specific, and does not use vague terms.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1faf5c50-73ac-4d52-8dac-d6fc9acadcdd
Commits

Reviewing files that changed from the base of the PR and between 703f8a7 and 5c4d44c.

Files selected for processing: 3

  • pm-stack/opencode-claimant/claimant.py
  • pm-stack/opencode-claimant/test/test_claimant.py
  • pm-stack/opencode-claimant/test_claimant.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 mentioned this pull request Nov 22, 2026
OpenChamber dispatch v1.1: admission control, hand-backs, stall nudges, harvesting, Workhorse-first routing #1187
Open
5 tasks
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 22, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pm-stack/opencode-claimant/claimant.py
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:

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 22, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pm-stack/opencode-claimant/claimant.py
stopped = True
continue
packet = candidate.get("packet", {})
note_posted = _post_hand_back_note(task_id, candidate, packet, cap_room)

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 22, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pm-stack/opencode-claimant/claimant.py
Comment on lines +1184 to +1186
"--platform",
"openchamber",
],

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 22, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Nov 22, 2026
epic(openchamber): session dispatch + babysitting — OpenChamber as the fleet's workhorse executor #1234
Open
feat(opencode-claimant): stall nudges + stuck-holder escalation over babysitter verdicts (#1187) #12688
Merged
@dezren39

dezren39 commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.