Browse docs
Docs

Pull requests & the CI loop

What happens after you open a PR — CI tracking, capped fix-only turns, and auto-merge on green.

Opening a pull request is a publish action, not a checkpoint. Every message in a thread is already saved and rewindable — see checkpoints, stop & rewind — so a PR means something stronger: this work is ready to ship. One thread ships one PR; anything that comes after it continues in a fork or a follow-up thread.

Opening the PR

Commit Thread does the whole handoff. It drafts the title and body with an LLM, lets you edit both, then merges the thread's work into a feature branch and opens the pull request. Integration is never silent: everything reaches your default branch through a PR, so it passes review and CI like any other change. The mechanics of reviewing the diff first — the branch graph, per-commit diffs, View in IDE — live in Git, diffs & Commit Thread.

If PR creation hiccups on a GitHub blip, the merge to the feature branch still lands and you get a one-click Retry PR. And if you want a second pair of eyes before it goes up, a review pass can run first — the code reviewer and security reviewer are described in the agent roles reference.

The loop that runs without you

Once the PR is open, the orchestrator keeps working on it:

  • It tracks CI and surfaces check status on the thread's status banner.
  • When checks fail, the agent gets a fix turn carrying the failing job names and log tails.
  • Fix commits push automatically at turn end, the PR branch fast-forwards, and CI re-runs.
  • When checks pass, the PR is ready to merge.
PR opened ─▶ CI runs ─┬─ green ─▶ ready to merge (auto-merge lands it if armed)
                      └─ red ──▶ fix-only turn ─▶ push ─▶ CI re-runs

Fix-only, by design

A CI fix turn is deliberately narrow. The agent makes surgical edits to satisfy the failing check — no behavior changes, no refactors, and no weakening or deleting tests to get green. If the real fix is bigger than that, the agent stops and asks you rather than pushing speculative commits.

Two more guardrails keep the loop honest:

  • Attempts are capped. The loop can't grind on forever.
  • Environmental failures stop early. If the failure looks like a flaky test, a network blip, or a third-party outage, the agent says so and stops instead of pushing noise.

Auto-merge

Auto-merge is a switch you arm per thread. When it's armed, green checks land the PR without you. When it isn't, nothing merges — the PR simply waits, ready. You can flip the switch either way at any time while the PR is open.

Armed PRs don't jump the line: they land through the merge queue, which groups open PRs by the files they touch so unrelated work lands in parallel and overlapping work lands in order.

While the PR is open

Long-running PRs drift as main moves. Threads with an open pull request pull in merged changes at the start of each turn, and you can bring one current deliberately at any point — see update from main.