Repository navigation
feat: let merge conflicts bring agents back to their pull requests - #238
Merged
kalaspuff merged 3 commits intoOct 23, 2026
Merged
Conversation
…se branch Projects can turn on a fourth follow-up, merge conflicts: when GitHub says a pull request one of fctl's agents opened conflicts with its base branch, the session that opened it hears of it in a message from fctl, which tells the agent to merge the base branch in, resolve the conflicts and push. GitHub sends no delivery when a pull request starts to conflict, and works mergeability out only when asked, so fctl asks: after a merge into a repository, about the other pull requests sessions list there; after any delivery's lookup; and when a session finds a pull request. While GitHub doesn't know yet, the session that opened it asks again, 15 s, 30 s, 1, 2 and 4 minutes later.
A session dropped conflicts as old news when its pull request's checks, from its last full lookup, were another commit's. Lookups without checks don't update those, so when the lookup after a push failed, or the push's delivery went missing, fresh conflicts at the new head were dropped until the next full lookup. Items now carry when their lookup asked GitHub, and only a later lookup that saw another head makes conflicts old news (follow_ups::conflicts_still). Seen end to end: a stopped session now resumes for them. The message says "has conflicts with main", which reads better before "until they're resolved".
Architecture, ADR 0045, self-hosting, the CLI, automation, development and the agent instructions say what conflict follow-ups do: when fctl asks GitHub, how often it asks again, what the agent is told, and how often in a row.
kalaspuff
approved these changes
Oct 23, 2026
kalaspuff
deleted the
fctl/180-it-would-be-great-if-agents-could-automa
branch
October 23, 2026 17:27
6 tasks done
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.
Projects can now bring their agents back when a pull request they opened conflicts with its base branch, the fourth follow-up after comments, failed checks and merges (#228). The agent hears of it in a message from fctl, which resumes its session if it stopped, as for the others, and merges the base branch in, resolves the conflicts and pushes, so that nobody has to go to the session and tell it to. This was the open roadmap item "Follow-ups: merge conflicts with the base branch bring agents back".
What it does
fctl projects set --follow-ups conflicts(and inall),FollowUps.conflicts. An update that leaves it out (an older tab or CLI) keeps what was stored.mergeableout only when someone asks after either branch moved, in the background, sayingUNKNOWNuntil then. I checked that against a busy public repository: of 30 open pull requests, GitHub knew about none at the first query and about all 30 twenty seconds later. So the lookups now readmergeable:pull_requestworkflows. That's what happened in the screenshot that started this: the agent waited for CI that never came;webhooks::Fields::WithoutChecks, one point of the rate limit for up to 50) of the other pull requests sessions list there, neither merged nor closed, whose projects follow up on conflicts (pull_requests::moved_onto).askstable): 15 s later, then 30 s, 1, 2 and 4 minutes (ASK_AGAIN_MS), and after that leaves it to the next delivery.follow_ups::message): that the pull request has conflicts withmainat its commit, so it can't merge and GitHub runs none of itspull_requestworkflows; to merge the updated base branch in (git fetch origin main && git merge origin/main), resolve each conflict so that both sides' changes still do what they were for, run the tests and push; not to rebase or force-push; and to ask on the pull request when a conflict takes a decision the code doesn't answer.web#12at3f2a1c9, with what fctl told the agent a click away (GitHub's alert octicon, in the caution color); a muted line and a note for held ones; the switch; and the session page's hint under its pull requests ("…failed checks, merge conflicts and merges do too.").Decisions worth a look
A bug the end-to-end run found, fixed here
A session dropped conflicts as old news when its pull request's checks, from its last full lookup, were another commit's. Lookups without checks don't update those, so when the lookup after a push fails, or the push's delivery goes missing, fresh conflicts at the new head would have been dropped until the next full lookup, up to six hours later. Items now carry when their lookup asked GitHub, and only a later lookup that saw another head makes conflicts old news (
follow_ups::conflicts_still, ac45793).What instance admins need to do
Nothing: no new permission and no new event. The lookups use the Pull request events the app gets already. Projects turn the switch on.
Compatibility
All additive.
FollowUps.conflictshas a serde default, and settings updates without it keep the stored value. Older clients readFollowUpEvent::Conflictsasother, and older CLIs show the message's text. The internalPullRequestsSeen.asksandfollow_ups::Item.seenare new too, and the session object creates itsaskstableIF NOT EXISTS. No migration. Hosts and agents need nothing: they get the message as any other.How I verified it
mergeable, and the fragment without checks (webhooks); conflicts as news only for open pull requests with a head; when to ask again and when to stop; keys, one per commit; the message with and without a base; held text; the in-a-row count kept apart from checks; staleness by lookup time (follow_ups); settings that keep an unsentconflicts; the CLI flag and its words; the proto wire format; fake-claude's answer; and the web helpers and component (follow-ups.test.ts,follow-up.test.tsx).cargo xtask checkpasses.cargo xtask dev, with a throwaway GitHub App and a local stand-in for GitHub's API whosemergeableanswers I controlled. A bare repository stood in foracme/web, and a stand-inghlet fctl-agent find the pull request. A local patch, reverted, pointed the Worker at the stand-in. Signed deliveries:mainthat GitHub needed three asks for: lookups at 0, +15 and +45 s, then the message.Screenshots
From
cargo xtask devwith the runs above, at acc166c.Settings → Pull requests, before and after (light):
Dark, and on a phone (390 px):
A session brought back by conflicts: the agent pushed its pull request, fctl found it conflicts with
main, and the agent answered. The hint under its pull request names merge conflicts (light, dark):What fctl told the agent, opened (light; dark on a phone):
Held after three in a row:
Other repositories
Session: https://app.fctl.sh/s/ses_01M5MGQHZD2ZJBX9JZEJ3NKZV4