Repository navigation
Conversation
|
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 45 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef666518f2
ℹ️ 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".
| if is_stale_binding(row): | ||
| return False |
There was a problem hiding this comment.
Distinguish historical clears from unreconciled ledger bindings
When a previously launched task is requeued after a transient failure, lease expiry, or park release, this gate now excludes it even after a fresh claim and handoff with an empty lane-ledger binding. The current transitions in migration-0023.sql deliberately write session_cleared while clearing both bindings atomically, and claim_repo_task preserves that historical marker. Consequently, the marker does not distinguish the legacy inconsistency from a normal retry. Neither claimant.py nor prompt.md consumes the new stale_binding list to reconcile these rows, so legitimate retries that previously launched are stranded. Preserve the fail-closed behavior for genuinely ambiguous bindings, but provide a verified reconciliation path before excluding every task with this audit marker.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Dispositioned by task 13293 (lane any-a), 2026-11-11: this finding was against the first revision (ae08110). The head revision (d5099ff) replaced the marker-only veto with the lane-ledger-authority rule described in the PR body — cleared marker + ledger session bound -> not a candidate; cleared + ledger unbound -> normal candidate — which is exactly the historical-clear distinction this finding asked for. The PR is being closed as superseded by the claimant rewrite on main (see the disposition note on PR #7059), and the classification rule + its tests are preserved on issue #5508 for the port.
Review: the stale-binding heuristic also blocks every legitimate relaunchRead-only review of The over-broad clausedef is_stale_binding(row):
prog = row.get("progress") or {}
cleared = prog.get("session_cleared")
return (prog.get("lane") == "opencode"
and not prog.get("session_id")
and isinstance(cleared, dict)
and bool(cleared.get("session_id")))
Those are the correct paths: they clear {"lane": "opencode", "stage": "handed_off",
"session_cleared": {"session_id": "ses_prior", "via": "expire_leases"}}with a clear ledger. Under this PR that row is no longer a candidate and is reported as So the fix currently suppresses the launch of precisely the tasks the claimant exists to relaunch after a lease expiry, and it does so permanently. Task 10474 itself (7 attempts, several bound-and-cleared cycles) is an example of the shape. The state the issue actually describes
Suggested shape
That also gives Also unaddressed
Verification run on the PR head
I have not modified the branch. The owner queue task (10474) is parked with this note as its resume brief. |
…code-claimant-ledger # Conflicts: # pm-stack/opencode-claimant/test_poll.py
|
🤖 Agent note · picked up
Resumed an existing branch from a prior attempt ( Verified locally: |
The previous revision vetoed every row carrying progress.session_cleared,
but every correct binding-clear path (claim_repo_task, expire_leases,
park_task, fail_repo_task, revalidate_parked_tasks) stamps that marker
while clearing progress.session_id and the lane ledger together. So a
task that was ever bound, had its lease expire, and was re-claimed and
re-handed-off was permanently suppressed: "never launched" instead of
"re-offered then bind rejects".
Consult the ledger instead. is_candidate / is_stale_binding take an
injected ledger_lookup (default: `repo-queue lane <task_id>`):
- ledger session_id non-null -> stale binding, not a candidate (the
genuine #5508 case; the real id is surfaced as ledger_session_id)
- ledger session_id null -> cleanly cleared, normal candidate
- ledger unreadable / no row -> fail closed (stale, not a candidate)
main() reads each cleared row's ledger once and shares it between both
classifiers, so a task is never both a candidate and stale.
Verified against the live ledger: tasks 4924/6719/6774 classify stale
and are suppressed; a cleanly-cleared row stays a candidate. test_poll
63/63 pass.
|
🤖 Agent note · parked
Where it standsImplementation is complete and pushed: Verified locally: Why parkedAll CI checks were still For whoever resumesRead the PR's check state fresh. The merge is not blocked on anything but checks: no hard-stop labels, and |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5099ff3fa
ℹ️ 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".
| return None | ||
| try: | ||
| result = subprocess.run( | ||
| [str(REPO_QUEUE_CMD), "lane", str(task_id)], |
There was a problem hiding this comment.
Read the ledger without invoking lane assignment
When a cleared-progress task has no ledger row, this command creates an assignment rather than failing closed. The CLI's cmd_lane calls /lane, which dispatches to assign_repo_task_lane (pkgs/fleet/crates/fleet-queue/src/queue_broker.rs:587–595); that function inserts a ledger row and updates progress.lane when the ledger is absent (migration-0021.sql:31–65). The returned row has no session binding, so the classifier accepts the original opencode snapshot even if this new assignment selected the direct lane. Use an actual read-only ledger lookup so polling cannot mutate assignments or turn missing ledger state into permission to launch.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Dispositioned by task 13293 (lane any-a), 2026-11-11: VALID — confirmed against current main. fleet queue lane is the broker's /lane assign verb (assign_repo_task_lane inserts a ledger row and updates progress.lane when absent), and the broker exposes no read-only lane-ledger read (/list rich does not select the ledger session_id either). A poll-side lookup therefore cannot be both read-only and authoritative today. This finding blocks merging PR #7059 as written; the PR is closed as superseded by the claimant rewrite on main (#7325 rich /list, #8234 handoff sink, #8187 direct-by-default), and the fix rule + this requirement (a read-only ledger read must exist first) are recorded on issue #5508 as the porting follow-on.
|
Agent note (lane code-j, task 13293): PR #7059 carries user/review — per runbook that means the reviewing worker (claimant session, execution lane opencode) reviews it first and proceeds on verified merits; it is not a hard stop and no hard-stop labels are present. Flagging here so the claimant dispositions the review before merge. |
|
Agent note — task 13293 (PR #7059, batch issue #7297): claimed by lane code-l, execution lane assigned opencode. Handed off to the opencode claimant to launch the bound session; the claimant session reviews PR #7059 first (user/review) and proceeds per the standing merge criteria. (User-token comment route rate-limited; posted via developing.today App.) |
|
🤖 Agent note · handed off
|
|
🤖 Agent note · done — PR closed as superseded (task 13293, lane any-a)
|
Summary
Fixes #5508.
poll.pyre-offered claimed opencode-lane tasks whoseprogress.session_idhad been cleared but whose lane-ledger binding remained: the claimant created a session per fire andbindrejected it — permanently.The first revision of this PR vetoed every row carrying
progress.session_cleared. That was wrong: every correct binding-clear path (claim_repo_task,expire_leases,park_task,fail_repo_task,revalidate_parked_tasks) stamps that marker while clearing progress and the ledger together. It would have replaced "re-offered then bind rejects" with "never launched", permanently suppressing any task that was ever bound, had its lease expire, and was re-claimed and re-handed-off.This revision makes the lane ledger the authority:
ledger_lookupdefaults torepo-queue lane <task_id>(read-only SELECT).main()reads each cleared row's ledger once and shares it between both classifiers, so a task is never both a candidate and stale. The stale entry now carriesledger_session_id(the id the claimant would have collided with) andledger_readable.Evidence
python3 -I test_poll.pyinpm-stack/opencode-claimant/— 63/63 pass (was 51).handed_offis a candidate; cleared+bound is not; unreadable ledger fails closed; uncleared rows never read the ledger;fetch_lane_ledgerreturns None on non-zero exit, malformed JSON and missing id.stale=True, candidate=Falsewith their real bound session ids; a cleanly-cleared row classifiesstale=False, candidate=True.handed_off/launch_failedstage gate and the OpenChamber UUID-lane exclusion inis_candidateare preserved (existing tests unchanged and passing).Acceptance item 3 (legacy bindings)
Tasks 4924 / 6719 / 6774 are surfaced by
stale_bindingbut not cleared by this PR. Clearing a lane-ledger binding is a queue-state write, not a code change, and this worker does not mutate queue rows from a PR. Deferral recorded here deliberately: the classification fix stops the wasted session-create/bind-reject cycle on its own, and the three rows are named so a queue-state pass can clear them.Merge Danger
Door: two-way.
Blast Radius: low. Only claimant candidate classification/reporting and its test suite. No queue state is written by this PR.