---
title: "Pull requests"
---

# Pull requests

Open a GitHub pull request from an Agents app session, choose draft and merge options, let the agent address reviews and CI failures, start a session from an existing pull request, and hand off context to reviewers.

A session's branch can become a GitHub pull request without leaving the Agents app, and a pull request can become a session. These features come from the agents window of Code - OSS and use your GitHub account; Neural Inverse adds context handoff to reviewers and governance of what the agent does.

## Maturity

The pull request features are inherited from Code - OSS. Neural Inverse's own description of the GitHub service in the source is a draft design, and this documentation does not claim they have been verified beyond that. They work with GitHub only.

## Before you start

- The session works in a git repository with a GitHub remote.
- You are signed in to GitHub in the Agents app (**Sign in with GitHub** in the account menu).
- Pushing, network access and the agent's commands remain governed: your organisation's policy decides them as for any other action.

## Create a pull request

1. In a session with changes, choose **Create PR**.
2. The form opens at once and fills in a generated title and description ("Generating pull request title and description."). You can type while it generates; anything you type is kept.
3. Choose the options:
   - **Create as Draft** keeps the pull request in draft until it is ready for review.
   - **New branch** creates and switches to a new source branch before committing.
   - The merge option (below).
4. Choose **Create pull request**. The form closes, and the app commits any uncommitted changes, pushes the source branch as needed, and creates the pull request in the background.

**Send Create PR Message**, in the **Pull Request Actions** dropdown, instead asks the session's agent to create the pull request with your options and write its own title and description. The last action you used becomes the primary button; Ctrl+Enter (Cmd+Enter on macOS) runs it. Escape closes the form and keeps your text; **Cancel** discards it.

Draft and merge choices are remembered across sessions in your profile.

### Merge options

| Option | What it does |
|---|---|
| **Merge Manually** | Leaves the pull request open for you to merge |
| **Agent Merge** | The agent keeps the pull request mergeable: **Address Reviews** when there are unresolved review comments, **Fix CI Failures** when required checks fail, and resolving conflicts or updating a branch that falls behind. **Merge Pull Request** then decides whether it merges: off, only if Agent Merge made no changes (**If Unchanged**), or when ready. Additional agent usage may apply. |
| **Auto-Merge** | Asks GitHub to merge when required checks and approvals pass, with a merge method the repository allows (merge commit, squash or rebase). Not available for drafts, and only when the repository enables it. It does not fix failing checks or address reviews. |

Session settings change only when you submit the form.

## Work on an existing pull request

- In a repository section of the sessions list, the **New Session** split button has **New Session from Pull Request**. It opens a searchable picker of pull requests grouped by review and assignment status. Choose one to start a session on it.
- In a session's diff, **Add PR Comment** (when enabled) adds a review comment on the pull request instead of feedback to the agent.

## Hand off context to reviewers

When your organisation uses the Context Platform:

- When a session opens a pull request, the app offers: "This session opened pull request #N. Hand its context to the reviewers?" Confirming turns the passages the session retrieved into a snapshot and a handoff on the pull request, optionally with a note. **Do not offer again** silences it.
- When you work on a pull request someone else opened and the author handed off context, the app offers: "The author of pull request #N handed off the context they used. Load it for this session?"

The setting `neuralInverse.context.autoHandoffOnPullRequest` (`ask` or `never`) controls both. See [Organisation context](https://neuralinverse.com/docs/editor/context/).

## After the pull request

With `sessions.autoArchiveOnPullRequestClose`, a session is archived once every pull request it opened is merged or closed. Each session can change this from its pull request bar.

What binds at merge is your CI: under an organisation policy, `ni-gov gate merge` verifies every approval record and the work item trailer of every commit on the exact commit. See [Intent, projects and releases](https://neuralinverse.com/docs/editor/intent-and-projects/).
