Repository navigation
Conversation
…rktree lock Architecture-Review: unchanged; admission still uses the existing marker and lock and queue waiting starts after the lock is released. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on e4eb71bede3db393ae00603fc0ade05d3eabf1f5, 35.2s: approve (0 critical, 0 important, 2 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| if not confirmed and confirmed_marker: | ||
| closed: list[github.GhError] = [] | ||
| if sha := _mergify_departure(config, pr, queue, closed, confirmed=True): | ||
| with _lock_task_state(wt): |
There was a problem hiding this comment.
suggestion: Worktree lock is held across several GitHub round-trips that other task-state writers share
_lock_task_state is the same flock that _save_report (cli.py:374) and the other task-state writers (cli.py:544, 675, 860) use. Admission now holds it while it pages issue comments (markers), reads membership, calls merged_sha, may post mark_confirmed, may build a departure report, and on a lost reply runs a second markers page read. Each of these can take up to the gh timeout, so a concurrent loopzero check can block for several timeouts before it publishes its receipt. This is correct, since it is released before _wait_for_mergify as the acceptance requires, but it is broader than needed. If contention matters, a smaller fix is to move the lock-free reads (merged_sha and the confirmed/departure handling) outside the lock. The lock would then cover only re-reading markers/membership and the request POST. Alternatively, add a comment explaining why the wider scope is intentional.
| def request(repo: str, number: int, head: str, queue: str) -> None: | ||
| body = f"@mergifyio queue\n\n{_marker(REQUEST, head, queue)}" # Mergify deprecates naming the queue | ||
| github._api(f"repos/{repo}/issues/{number}/comments", {"body": body}) | ||
| try: |
There was a problem hiding this comment.
suggestion: Lost-reply recovery in request is only correct when the caller holds the admission lock
The fallback treats any existing REQUEST marker for this head and queue as proof that this POST was accepted. That holds only because the caller re-read the markers under _lock_task_state and found none. request is a public module function with no such precondition in its signature, so a future unlocked caller could take a marker from an earlier run as its own success. A one-line docstring would document the precondition: the caller must have seen no marker under the worktree lock.
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on 98cf014b38ed88cb6f4045229b7c65b088ccc544, 7.7s: approve (0 critical, 0 important, 0 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
…request-replacement
Superseded by #1806 after resolving the conflict with main’s queue budget check. Both review rounds were already used here.
Serialize Mergify queue requests in a task worktree
Context and goal
Closes #1327
Acceptance
Notes
Replaces Serialize Mergify queue requests in a task worktree #1346 after Loop Zero declined a delta review of the conflict-resolved merge. Retains the queue-departure reporting from Report Mergify departures for the current queue attempt #1357.
The shared GitHub comments fake reproduces the race with an accepted write and a lost reply. Focused Mergify tests passed.
Base
Base: b8abab8
Validation
(no
loopzero checkrun recorded)Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review