Skip to content

Continuation of an existing Issue branch #6

Closed

Description

@JacobStephens2

Parent

#2

What to build

Continuation (ADR-0002). Issue branch selection looks at the remote Issue branches for the issue and all their PRs, whatever their state, using one git ls-remote and one gh pr list --state all. If the highest-numbered Issue branch exists on origin with no PR or an open PR, the run continues it:

  • The worktree checks out the existing Issue branch from origin, not a new one from the Base branch.
  • The session gets the continuation prompt from the spec: the "update PR " form if an open PR exists, otherwise the create-PR form.
  • With an open PR, that PR's base becomes the Base branch (the review fixed point and the target), and the Base branch pre-flight checks apply to it. If it differs from the branch checked out in the launch directory, stderr says so.
  • A local Issue branch in the launch repo that points somewhere other than its origin copy → error before anything is created.

Acceptance criteria

  • Existing issue-<n> on origin with no PR → continued; the agent's new commits sit on top of the existing ones; the continuation prompt uses the create-PR form
  • Existing issue-<n> with an open PR → continued; the continuation prompt names the PR URL and uses the update form; the same PR is the result
  • Open PR base main while develop is checked out → the Base branch is main in the prompt and checks, with a note on stderr
  • A local issue-<n> that differs from origin/issue-<n> → error, and nothing created
  • A Continuation of a Failed run's branch (ending in a failure commit) works
  • Selection uses the remote branches plus PR history in at most two network calls

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions