Let agents open pull requests over MCP
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
- Chosen
- Write separate checks for agents.
- separate_checksThey can become different from the compare page over time.
Touches
sessions.tsindex.tsmcp.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