AUTO/YOLO agent pipeline: fix CI + code review via claude -p#25
Merged
Conversation
Implements the agent pipeline for PR autopilot modes: 1. Fix CI (hammer): when checks fail, spawn `claude -p` with the failing check details. AUTO uses --permission-mode acceptEdits with explicit tool whitelist; YOLO uses --permission-mode bypassPermissions. 2. Code review: when checks pass, spawn `claude -p` in read-only mode to review the diff. Outputs structured JSON findings (critical/important/minor). 3. Fix review: when Critical or Important issues are found, spawn `claude -p` to address them, then re-review (max 2 cycles). Pipeline state tracked on TrackedPR: AgentRunning (mutex-like string preventing double-spawn), ReviewState, ReviewFindings, ReviewCycle, AgentCostUSD. Stale agent timeout (20min) clears crashed processes. Review state resets on check regression so the full pipeline re-runs after CI fixes. TUI shows: agent status with elapsed time, review findings by severity with file:line locations, accumulated cost in PR header. New file: daemon/internal/pr/agent.go — claudeBin, cloneForAgent, command builders, spawn functions, parseReviewOutput, agentComplete callback.
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.
Summary
Implements the full agent pipeline for PR autopilot modes (AUTO/YOLO):
claude -pto analyze failures and push fixes--permission-mode acceptEdits --allowedTools "Bash Edit Write Read Glob Grep"--permission-mode bypassPermissionsclaude -pin read-only mode to review the diffclaude -pto fix themPipeline state machine
Safety
AgentRunningfield prevents double-spawn (only one agent per PR at a time)$5/$3/$5budget caps per agent invocationTUI
Test plan