Skip to content
Source
Sign inSign up

Resolve queue conflicts

Issues and pull requests / Pull requests

Let an agent resolve conflicts in the merge queue

A pull request with conflicts leaves the merge queue, and a person resolves the conflicts by hand. Turn on the agent, and the queue resolves the conflicts and goes on.

3 min read

The Keep green agent does this work, with its step Resolve conflicts in the merge queue. The step is on by default. The agent is off by default.

You need to be an admin of the repository.

1. Turn on Keep green

  1. Open the repository, then Agents, then Agents under Software factory (/@<owner>/<repo>/agents/factory). For every repository of an organization, open /organizations/<org>/factory.
  2. Turn on the switch of Keep green. It saves at once.

2. Check the merge queue step

  1. Click Settings next to Keep green.
  2. Make sure that the step Resolve conflicts in the merge queue is on.
  3. Optional: to change the model, pick the Model provider, the Model and the Reasoning.
  4. Click Save Keep green.

Note

The model of Keep green is also the model of its other steps, Resolve merge conflicts and Fix failing CI. To use only the merge queue step, turn the other two off.

Done

When the front pull request of a queue conflicts with its base branch, the agent resolves the conflicts. The queue then waits for the checks of the new commit, and merges the pull request. Nobody resolves the conflicts by hand.

What the step does

  • It runs only when the front pull request of a queue conflicts with its base branch. No other event starts it, and Who starts it does not change this.
  • It merges the base branch into the head branch, resolves the conflicts, and pushes a merge commit. It never force-pushes.
  • The queue then waits for the checks of the new commit, and merges the pull request.
  • For an author without write access, it runs only after a clean security audit of the head commit.

If the agent is off, or it did not resolve the conflicts, the pull request leaves the queue. See When a pull request leaves the queue.

Its model and its cost

  • When the forge has an AI Gateway set up, its default model is OpenAI's GPT-6.1 Terra (openai/gpt-6.1-terra on Workers AI), with medium reasoning. Without one, the default is Workers AI with @cf/deepseek-ai/deepseek-v4.1-flash-1017.
  • GPT-6.1 Terra costs $1 for each 1M input tokens, $0.05 for each 1M cached input tokens, and $5 for each 1M output tokens. The forge pays, and the cost counts toward the monthly spend cap.
  • A model with your own key does not count toward the cap. See Add a model key.