Skip to content

fix(dispatcher): a relay that already landed is not handed back - #260

Merged
Ardnived merged 1 commit into
mainfrom
claude/fix-relay-applied-twice
Nov 16, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/fix-relay-applied-twice

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

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:

Time (UTC) Run What it did
18:02:52 reconcile relay → fast-forwarded fix/geojson-feed-region-less-drafts to 0df323f, deleted the relay branch
18:03:09 unlock (the session's label removal) read the same sydevs-request, tried the relay again, found no branch → handback
18:03:28 synchronize kept the handback

Every run on a PR reads the same request until the next session fires, so the relay must be idempotent.

Change

  • decide: skip a relay whose sha is 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 (identical or ahead), 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.mjs passes, 356/356. With the source change reverted, the three new or updated relay cases fail.

🤖 Generated with Claude Code

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]>
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 16, 2026
@sydevs-bot

sydevs-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 22:41Z review-pr · attempt 1 · session · done
  • 22:41Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@Ardnived
Ardnived merged commit 3c1e044 into main Nov 16, 2026
6 checks passed
@Ardnived
Ardnived deleted the claude/fix-relay-applied-twice branch November 16, 2026 22:43
@sydevs-bot sydevs-bot moved this from Working to Done in SYDevelopers Technical Roadmap Nov 16, 2026
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants