Skip to content

feat(relay): tell an agent when a merged pull request conflicts with its work - #1268

Merged
omartelo merged 3 commits into
mainfrom
feat/merge-conflict-note
Dec 3, 2026
Merged

omartelo merged 3 commits into
mainfrom
feat/merge-conflict-note

Conversation

@omartelo

@omartelo omartelo commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

When the pull request of one session's checkout merges, the live agents in the repository's other checkouts whose work conflicts with it now get a note naming the files.

  • Criterion: a real conflict (git merge-tree against the fetched base, uncommitted and untracked work included), kept to the files that pull request changed. Sharing a file is not enough: of 299 neighbouring merges of this repository, 75% shared a file and 30% conflicted.
  • Timing: AnnounceMerge only records the merge. It is read when the session next writes or runs a command, so an idle session is not woken and the answer is about its work as it is then.
  • Delivery: the answer to a session-touched report, the channel of the edit-overlap note, as a notice envelope with the new topic merge-conflict. The read fetches, which outlasts the hook's timeout, so it runs behind the first report and a later one carries the note. lich-plugin needs no change.
  • Providers: the gaps are those of the edit-overlap note plus Cursor CLI's chat, which runs no hooks. They are in docs/ceilings.md and in every README's provider table.

The text an agent reads, in every prompt language:

Pull request #1210 "fix(relay): handshake race" was merged into main.
That merge conflicts with the work in this checkout in: internal/relay/conn.go. Before going on, read what it changed there with git diff HEAD...origin/main -- <file>: part of what you are doing may already be done. Do not merge or rebase in the middle of your task because of this notice alone.

No text was added to a screen.

Test plan

  • internal/project: real repositories merged by squash, merge commit and fast-forward, against committed, uncommitted, untracked, identical and already pulled work; the checkout and its stash list stay as they were.
  • internal/relay: a table over every provider, for hooks that answer and hooks that hold.
  • Backend gate, with the darwin and windows cross-compile.

Also here

A chat panel opened while another's read was running (/permissions right after /mcp) stayed on Loading: its read was skipped and the first one's answer dropped. The macOS runner hit it in TestPermissionsOpenOnTheAllowRules. The panel now reads once the running read lands, with a test that reproduces it.

…rry the note

Dropping it asserted an order the contract never promised: 7 failures in 9000 runs of each case, 0 after.
…ands

The read of the second panel was skipped while the first ran, and the first's
answer was dropped, so the second stayed on Loading. The macos runner was slow
enough to hit it in TestPermissionsOpenOnTheAllowRules.
@omartelo
omartelo merged commit cce1321 into main Dec 3, 2026
8 checks passed
@omartelo
omartelo deleted the feat/merge-conflict-note branch December 3, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant