Skip to content

Auto-update PR description after each fix iteration #64

@chanakyav

Description

@chanakyav

The fix prompt tells the agent to update PR title/description via gh pr edit when the approach changes significantly, but the agent almost never does it. The result is stale PR descriptions that don't reflect the work done across multiple fix iterations.

Proposed Approach

Move PR description updates from agent discretion to orchestrator-controlled — the orchestrator already has the fix summary data and knows exactly what changed.

PR Body: Update after each iteration

In _do_resolve_comments, after resolving all comments, append a changelog section to the PR body:

---

### Iteration 2 — autopilot-loop

**Comments addressed:**
- Comment 42 (billing.rb:15): FIXED — Extracted billing concern into separate module
- Comment 43 (user.rb:30): SKIPPED — Current pattern is idiomatic Ruby

**Commits:** abc1234, def5678

This uses gh pr edit --body to append (not replace) the iteration summary. Each iteration adds a new section, building a history of what was done.

PR Title: Update once at completion

In _do_parse_review when 0 unresolved comments are found (clean review → COMPLETE), optionally update the title:

gh pr edit --title "..."

The final title could be generated by asking the agent in the last fix pass, or by using the original task prompt as the base.

Alternatively, skip auto-title and just do the body updates — that's the higher-value change.

Implementation

  1. In _do_resolve_comments (orchestrator.py): after resolving comments, call gh pr edit to append iteration summary to PR body
  2. New function update_pr_body_with_summary(pr_number, iteration, summaries, commit_sha) in github_api.py
  3. Remove step 8 from fix_prompt (agent no longer responsible for this)
  4. Optional: update PR title at COMPLETE time

Open Questions

  • Should we append to the existing body or maintain a separate "autopilot-loop activity" section?
  • Should the iteration summary include the full comment text or just a brief note?
  • Should we get the PR's current body via gh pr view and append, or use a separate comment?
  • Alternative: post iteration summaries as PR comments instead of editing the body (less disruptive, more visible in the timeline)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions