docs
v0.7.8

Pull Requests

With GitHub integration and protected main branch enabled, the agent creates and manages pull requests.

Automatic PR creation

When protected_main is enabled on a project and the agent completes work on a ticket:

  1. The agent pushes the worktree branch to GitHub
  2. A pull request is created with the ticket title and description
  3. codality/agent check run is added to the PR
  4. The ticket moves to In Review

Subsequent agent runs

If you re-run the agent on a ticket that already has a PR, the agent:

  1. Continues working in the existing worktree
  2. Pushes new commits to the same branch
  3. Updates the PR head SHA

The existing PR stays open. No duplicate PRs are created.

PR status in the UI

The ticket detail shows PR status inline:

  • CI checks — Pass (✓), Fail (✗), or Pending (●) with a count of checks
  • Review state — Approved, Changes Requested, or pending review

This status updates in real time via webhooks.

Check runs

Codality creates these check runs on PRs:

Check When Result
codality/agent Agent starts/completes work Success if agent completed, failure if agent errored
codality/review Code review submitted in Codality Reflects review outcome
codality/merge-readiness After agent or review Summary of PR readiness

These check runs are separate from your CI checks (GitHub Actions, etc.). Codality monitors your CI checks for failures and responds to them. See CI Feedback Loop.

Merging

When a PR is merged on GitHub:

  1. Codality receives the pull_request webhook
  2. The ticket moves to Done
  3. The worktree is cleaned up
  4. The local repository syncs with the remote

Closing without merge

When a PR is closed on GitHub without merging:

  1. The ticket moves to Cancelled

Discarding from Codality

If you discard a ticket's worktree from the Codality UI and a PR exists:

  1. The open PR is automatically closed on GitHub
  2. The worktree is deleted locally

Rebasing

When someone pushes to the default branch (via merged PR or direct push):

  1. Codality receives the push webhook
  2. The local repository syncs with the remote
  3. All open worktrees are rebased onto the updated default branch

This keeps agent branches up to date automatically.