Skip to content

Resolve pipeline

The resolve pipeline takes a GitHub issue and turns it into a pull request. It's the most complex pipeline in Developer -- 13 stages with branching logic based on what the agent finds.

developer resolve assistant 25
developer resolve https://github.com/gregology/assistant/issues/25

Flow

flowchart TD
    A[triage] --> B{decision?}
    B -->|ask / propose| C[comment_draft]
    B -->|action_proposed / action_direct| D[implementation]
    B -->|decompose| DC[decompose]
    B -->|decline / decision| R[record_decision]
    DC --> DC1([create sub-issues])
    DC1 --> STOP7[STOP]
    C --> C1([post comment])
    C1 --> STOP1[STOP]
    R --> R1[craft_decision_pr]
    R1 --> R2([commit, push, open PR])
    R2 --> STOP6[STOP]
    D --> D1{diff empty?}
    D1 -->|yes| D2[infeasible_comment]
    D1 -->|no| E[evaluation]
    D2 --> D3([post comment])
    D3 --> STOP2[STOP]
    E --> F{decision?}
    F -->|needs_context| G[eval_comment]
    F -->|pass| H[docs_review]
    G --> G1([post comment])
    G1 --> STOP3[STOP]
    H --> Q{quality tools pass?}
    Q -->|yes| I[craft_pr]
    Q -->|no, attempts < 3| J[quality_fix]
    Q -->|no, attempts = 3| K[craft_draft_pr]
    J --> Q
    I --> I1([commit, push, open PR])
    I1 --> STOP4[STOP]
    K --> K1([commit, push, open draft PR])
    K1 --> STOP5[STOP]

Stages

triage

Reads the issue, explores the codebase, and picks a path. This is always the first stage. The agent returns a TriageResult with one of these decisions:

  • ask -- needs clarification from the issue author
  • propose -- wants to describe its approach before implementing
  • action_proposed -- ready to implement with a described approach
  • action_direct -- ready to implement immediately
  • decompose -- the issue is too large and should be broken into smaller sub-issues
  • decline -- the issue shouldn't be implemented (with reasoning)
  • decision -- this is an architectural decision, not a code change

decompose

Resumes the triage session and breaks a large issue into smaller sub-issues. The agent produces a DecomposeResult identifying the sub-issues, then post_decompose_action creates them on GitHub. Pipeline stops.

comment_draft

Resumes the triage session and drafts a comment. Used for the ask and propose paths. Python posts the comment. Pipeline stops.

record_decision / craft_decision_pr

For declined issues and architectural decisions. The agent updates the project's decision log, then crafts a PR documenting why it's not implementing the change. Even declines get tracked as PRs so there's a reviewable record.

implementation

A new session where the agent makes code changes in a git worktree. It has full read/write access to files but can't run git commands. After it finishes, Python captures the diff.

If the diff is empty (the agent couldn't figure out what to change), the pipeline routes to infeasible_comment instead.

evaluation

A fresh session that reviews the diff from the implementation stage. The agent decides:

  • pass -- changes look correct, move on
  • needs_context -- something is missing or unclear

If the agent says needs_context, it drafts a comment explaining what's missing and the pipeline stops. No half-baked PR.

docs_review

Resumes the implementation session. The agent checks whether docs need updating given the changes. After it finishes, Python runs the repo's configured quality tools.

quality_fix

If quality tools fail, the agent gets the tool output and tries to fix the issues. This can loop up to three times. If it still can't get quality tools to pass after three attempts, the pipeline moves to craft_draft_pr instead.

craft_pr / craft_draft_pr

The final stage. The agent crafts a branch name, commit message, and PR body. Python commits the changes, pushes the branch, and opens the PR.

craft_draft_pr is the fallback when quality tools won't pass. It opens a draft PR and notes the remaining issues so a human can finish up.

Session strategies

Stage Session Why
triage new Fresh start, no assumptions
decompose resume:triage Needs the triage context to identify sub-issues
comment_draft resume:triage Needs the triage context to write a good comment
record_decision resume:triage Needs the decline reasoning
craft_decision_pr resume:record_decision Needs both the decision and the triage context
implementation new Clean slate for code changes
infeasible_comment resume:implementation Knows what it tried
evaluation new Independent review of the diff
eval_comment resume:evaluation Needs the evaluation reasoning
docs_review resume:implementation Knows the codebase from implementing
quality_fix resume:implementation Needs the implementation context to fix issues
craft_pr resume:implementation Knows what changed and why
craft_draft_pr resume:implementation Same as craft_pr