Skip to content

feat(server): a thread can fix its pull request's failing checks and review comments on its own - #254

Merged
badcuban merged 1 commit into
mainfrom
threadlines/pr-auto-fix
Sep 6, 2026
Merged

feat(server): a thread can fix its pull request's failing checks and review comments on its own#254
badcuban merged 1 commit into
mainfrom
threadlines/pr-auto-fix

Conversation

@badcuban

@badcuban badcuban commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

A third switch in the composer's pull request popover, "Fix failing checks and review comments", arms the thread. While it is on, the server watches the pull request and, when a check starts failing or a reviewer comments, starts a turn in the thread with a message that names the failing checks (with links) and quotes the new comments, then asks the agent to fix them, run the project's checks, commit on the branch, and push. The message lands in the thread as an ordinary user message, so the wake-up is visible in the transcript.

How it is stored. thread.pull-request-automation.set is a new orchestration command; the decider emits thread.pull-request-automation-changed, the projector writes pullRequestAutoFix on the thread, and migration 052 adds pull_request_auto_fix INTEGER NOT NULL DEFAULT 0 to projection_threads with no backfill.

How it runs. PullRequestAutoFixWatcher is a reactor modeled on the auto-archive sweeper, forked in the server's reactor scope, so it exists only while the server does: a closed desktop app watches nothing. Every two minutes it reads the shell snapshot, takes armed threads that are open, on a branch, on a GitHub project, and idle (no running turn, no pending approval, question or plan), resolves the branch's pull request from git status, and reads the detail and activity fresh. The first observation of a pull request only records a baseline; it acts on changes seen after that. A pending check rollup never fires. It stops after three automatic turns per thread and pull request per server lifetime and logs when it does.

Client. The switch flips optimistically and follows the read model. A muted wrench appears in the row while it is on, with a tooltip. The switch is offered only for GitHub pull requests.

Not in this PR: persisting the watcher's baseline across restarts, GitLab and Azure hosts, sidebar markers, a settings-page entry.

Verified: fmt, lint, typecheck; server decider, projector, persistence and watcher tests (six watcher cases: baseline on first sight, a check turning failing, a comment firing once, archived and disarmed skipped, a busy thread keeping its baseline, the cap); contracts and shared tests; web logic tests; the ChatView dock browser test.

…review comments on its own

A third switch in the composer's pull request popover, "Fix failing checks and review comments", arms the thread. While it is on, the server watches the pull request and, when a check starts failing or a reviewer comments, starts a turn in the thread with a message naming the checks and quoting the comments, and asking the agent to fix them, run the checks, commit and push.

The switch is an orchestration event on the thread, projected to a new column with no backfill. The watcher is a reactor scoped to the server, so it runs only while the app is open. It records what it first sees and acts only on changes after that, skips threads with a turn in flight or a question pending, and stops after three automatic turns per pull request.

The row shows a small wrench while the switch is on.
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Sep 6, 2026 5:24pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL labels Sep 6, 2026
@badcuban
badcuban added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 0b777f9 Sep 6, 2026
16 checks passed
@badcuban
badcuban deleted the threadlines/pr-auto-fix branch September 6, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant