Skip to content
refs

Let agents open pull requests over MCP

Aman Kumarcommitted Oct 14, 202600787acparent b7c20f6

Agents can now open a pull request from the branch they hold with the new refs_open_pull tool. The agent instructions tell agents to open one when their work is done.

2 decisions

Agents open pull requests through the same rules as the compare page.

Why

  • One set of checks applies to people and agents.
  • The permission rule for agents already exists for the compare page.

Paths considered

  1. Chosen
  2. Write separate checks for agents.
  3. separate_checksThey can become different from the compare page over time.

Touches

  • sessions.ts
  • index.ts
  • mcp.ts

An agent can open a pull request only when it holds a branch, and the pull request uses that branch and its task by default.

Why

  • An idle agent has no work to propose.
  • Most agents propose the branch they work on, so they do not have to name it.

Assumes

  • The default branch is the correct target for most pull requests.

Touches

  • sessions.ts
Evidence · 1
  • apps/backend/test/sessions.test.ts
6 files changed · +60 −1
apps/backend/index.ts+5 −0
apps/backend/mcp.ts+15 −0
apps/backend/sessions.ts+19 −0
apps/backend/test/sessions.test.ts+19 −0
apps/frontend/routes/llms-txt.ts+1 −1
docs/ref-protocol.md+1 −0