Docs

Working as a Team

Auto-merge

Auto-merge lets an agent merge a task's pull requests for you, once the coding agent is done and the checks pass.

What auto-merge does

With auto-merge on, every open pull request of the task gets a merge run. The task's merge agent works each run: it rebases the branch, fixes conflicts and failing checks, and pushes the fixes. Gleamrun merges the pull request only when every merge rule passes. The task moves to Done once at least one pull request merges and every other linked pull request is merged or closed.

Auto-merge is a setting on the task. A pull request that is linked after you turn it on gets its run within a few minutes.

Turn it on

  • When you create a task: pick Auto-merge from the launch menu next to the submit button. The agent starts, then its pull requests merge when they are ready.
  • On an existing task: click the auto-merge icon in the task details header, in the agent session header, or next to the Pull Request picker in a session's Artifacts panel.

The icon turns orange while auto-merge is on. Board cards show the same icon. Turning auto-merge on needs a workspace role that can merge pull requests.

Turn it off

Click the auto-merge icon again and confirm Turn off auto-merge. This stops automatic merge runs. Manually started merge runs continue. When you turn auto-merge on again, the merge agent starts right away.

Auto-merge also turns off when you stop the merge agent: when you press Stop on a pull request's merge run, or when you stop the merge agent's session.

Merging a pull request yourself keeps auto-merge on. Its merge run ends as merged, and the merge agent continues with the other open pull requests of the task. A Follow up from the Review Hub also keeps auto-merge on. The merge agent waits for the coding session and then continues. When auto-merge stopped because it needed a person, the follow-up turns it back on.

Why nothing has merged yet

Auto-merge can be on while no run has started. A run starts once all of these are true:

  • An open pull request is linked: the coding agent links the pull requests it opens. Until then there is nothing to merge.
  • The coding agent is idle: no run starts while the task's coding session works or has a queued message.
  • The review rule allows it: when the workspace requires a review agent, the run waits for that review. Gleamrun starts the review if it has not run on the latest commit.
  • No person stopped the last run: when you turn auto-merge on again after a person pressed Stop on a pull request's run, auto-merge leaves that pull request alone.

Once a run starts, the Agent Merge card in the task's Review Hub shows what it waits for.

Pull requests with no CI checks can merge

Usually every check must finish and at least one must pass. If Gleamrun verifies that CI is not required, a pull request with zero checks or only skipped checks can also pass this rule. It must first go five minutes without a pull request update. A failed check still blocks merging. Branch protection, required reviews and merge queues still apply.

A run can wait for an external blocker, such as failing base-branch CI, a draft, or another pull request. Its Agent Merge card shows Waiting and the reason. The merge agent resumes when the blocker clears. If the blocker remains past its limit, Gleamrun hands the run to a person.

When auto-merge turns itself off

  • No supported pull request: the agent cannot merge a pull request from a fork, from a read-only repository in the stack, or on an unsupported provider.
  • Lost access: the person auto-merge acts for can no longer open the task or merge pull requests in the workspace.
  • The merge agent gives up: the people who own the run get a notification, and the pull request bar says why. Fix the cause with a follow-up to the coding agent; when a person who can merge sends it, auto-merge turns back on.

Finding fixes and alerts

By default, the merge agent repairs conflicts and CI failures in tests, type checks, lint, and builds. Blocking review findings need a person or the task’s coding agent. Admins and owners set finding fixes in Settings to Merge policy, in the Agent merge column. Set it for the whole workspace, a role, or a person. The most specific setting wins. It applies to merge runs that person starts.

  • Off (default): the merge agent sends no findings. Findings that your review rules block stop agent merge.
  • Fix findings: after checks finish, the merge agent sends every unresolved finding, blocking ones included, to the coding agent.

Review and merge requirements still apply.

Under User Settings to Notifications → Agent merge, use Your alerts to choose Slack, Microsoft Teams, or Telegram, then Save merge alerts. These personal alerts are off by default and need your connected account. They notify you when the merge agent needs attention.