Repository navigation
fix(dispatcher): a relay that already landed is not handed back - #260
Merged
Merged
Conversation
Every run on a PR reads the same sydevs-request until the next session fires, so two runs can each try to land one relay. On SahajCloud#1167 a reconcile fast-forwarded the PR branch to 0df323f and deleted the relay branch; the unlock run 16 seconds later read the same request, found no relay branch, and handed the PR back with "does not exist" although the work had landed. decide now skips a relay whose commit is already the PR's head, and applyRelay checks, before refusing over a missing or moved relay branch, whether the PR branch already contains the requested commit (which also covers a relay landed by server-side merge, where the head is a merge commit and not the requested sha). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
This was referenced Nov 16, 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.
Failure this prevents
On SahajCloud#1167 the dispatcher handed the PR back with cannot apply the relay —
claude/relay-1167-0df323f does not exist, although the relay had already landed:reconcilefix/geojson-feed-region-less-draftsto0df323f, deleted the relay branchunlock(the session's label removal)sydevs-request, tried the relay again, found no branch → handbacksynchronizeEvery run on a PR reads the same request until the next session fires, so the relay must be idempotent.
Change
decide: skip a relay whoseshais already the PR's head.applyRelay: before refusing over a missing or moved relay branch, compare the requested commit with the PR branch. If the branch already holds it (identicalorahead), it counts as landed, with no write. This also covers a relay landed by server-side merge, where the head is a merge commit and not the requested sha. A compare that fails with 404/422 still refuses as before.docs/why.md#the-relay: records why.Tests
node --test dispatcher/test/*.test.mjspasses, 356/356. With the source change reverted, the three new or updated relay cases fail.🤖 Generated with Claude Code