Pull requests in Code sessions
A Code session can follow the GitHub pull request for its branch. Its header shows the PR's number and whether its checks pass. For sessions in general, see the code-sessions page.
See the PR a session opened
After each turn, Haruspex looks for an open PR on github.com whose branch is the session's branch. When it finds one, the badge #123 appears after the branch name. Nothing happens on the repository's default branch, or in a folder whose origin isn't on github.com.
It works however the PR was opened: by the agent, in a terminal or on github.com. A session follows one PR. It keeps that PR until the PR is merged or closed, or until you pick Unlink, even when you switch branch.
Haruspex reads GitHub with your own gh, run where the session's git runs (inside the distro for a WSL session). If gh isn't installed or signed in, it uses the GitHub MCP server instead, when that is running (see the mcp-servers page). With neither, no PR is found, and Link PR… says why.
Link a PR by hand
When the header shows Link PR…, click it, paste the PR's address (https://github.com/owner/repo/pull/123) and press Link. The PR must be in the session folder's own repository and still open; otherwise one line says why not.
What the badge shows
The dot is the PR's state, worst first:
- purple: merged;
- grey, number struck through: closed;
- amber: it conflicts with its base branch;
- red: a check failed;
- grey: checks are running, or there are none yet;
- green: every check passed.
Point at the badge for the PR's title, its state, whether it was read through gh or the MCP server, and when it was last checked. A faded dot means the last check couldn't reach GitHub, and the tooltip says why.
Click the badge for Open on GitHub, Auto-merge, Auto-fix, the failing checks (click one to open its log on GitHub), and Unlink.
Merge it when the checks pass
Tick Auto-merge in the badge's menu and GitHub merges the PR once its required checks pass, using the first method the repository allows: squash, then a merge commit, then rebase. A ⇣ after the number shows it is on. Untick it to turn it off. It is GitHub's own auto-merge, so turning it on or off on github.com shows here too, and it keeps working while Haruspex is closed.
When the base branch merges through a merge queue, the item reads Merge queue and adds the PR to the queue or takes it out.
It needs gh signed in: over the GitHub MCP server the item is greyed out. On GitHub, the repository must allow it: its Settings → General → Allow auto-merge. A PR that can already be merged has nothing to wait for, so the item says to merge it on GitHub.
Let the session fix it
Tick Auto-fix in the badge's menu and the session fixes its own PR. When a check fails, the PR gets a merge conflict, or someone comments, the session starts a turn of its own once it is idle. That turn opens with a message marked [Auto-fix] that lists what went wrong, with the failing lines and end of each failed check's log (up to three), and each new comment. The agent then fixes it, commits and pushes. It also takes on the failures the PR already has.
The turn follows the session's usual rules: Settings → Code → Max steps per task, and the approval prompt for risky commands. When an Auto-fix turn waits for your approval, a notification says so. A turn you stopped holds Auto-fix back until you send the session something. If the session's sub-tab is closed, Haruspex opens it in the background without switching to it.
Each problem gets a few tries: Settings → Code → Auto-fix tries, 3 by default. When a problem is still there after that many turns, Auto-fix turns itself off and a notification names the problem. The badge's menu then lists what is left under Waiting. Tick Auto-fix again to give it more tries. Comments don't count towards the limit.
Auto-fix needs push access to the PR's branch, so the item is greyed out on someone else's PR. It works over gh or the GitHub MCP server. While it is on, the failed-check, conflict and comment notifications stop, because the session handles those. Merged, closed and all-passed still notify, and Auto-fix turns itself off once the PR is merged or closed.
How often it checks
Haruspex checks a PR every minute while its checks run, and for half an hour after anything changes. After that it checks every five minutes. It also checks when the window comes back into focus, and after a turn that ran git push or gh pr. It keeps checking while hidden to the tray.
Get told when it changes
Haruspex sends a desktop notification when a PR:
- is merged, or closed without merging;
- passes every check;
- fails a check (it names the first one);
- gets a merge conflict;
- gets a comment from anyone but you, bots included.
With Auto-fix on, the last three don't notify; the session wakes instead. A merge or close wakes no turn; the session's next turn is told of it.
Each comes once: a check that keeps failing on the same push doesn't notify again, and the comments already on a PR when it is bound don't notify at all. They arrive while the window is hidden to the tray too. To turn them off, use your desktop's notification settings for Haruspex.
What it doesn't do
- Auto-fix replies to a comment in the session, not on GitHub, when it shouldn't act on it alone.
- It only knows github.com, not GitHub Enterprise, GitLab or other forges.
- It doesn't check while Haruspex is closed or the computer sleeps. It catches up when the app starts again.
- A session on another computer shows no badge here. That computer's Haruspex follows its PR.