feat(server): a thread can fix its pull request's failing checks and review comments on its own - #254
Merged
Merged
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
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.setis a new orchestration command; the decider emitsthread.pull-request-automation-changed, the projector writespullRequestAutoFixon the thread, and migration 052 addspull_request_auto_fix INTEGER NOT NULL DEFAULT 0toprojection_threadswith no backfill.How it runs.
PullRequestAutoFixWatcheris 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.