Pull request create failed: GraphQL: Resource not accessible by integration (createPullRequest)

Where does the bug appear (feature/product)?

Background Agent (GitHub, Slack, Web, Linear)

Describe the Bug

I’ve set up my cloud agent to have its own environment, and everything around that works well. The agent spins up, makes the fixes, tests in the environment, and produces a testing video. However, it just fails at the step of creating the PR.

cd /workspace && gh pr create --draft --title "TOM-1522: Add site column to invoice table" --body "Fixes TOM-1522

Adds a **Site** column to the invoice table on the Invoice Page, positioned between Type and Matched PO. This helps users understand which site an invoice is associated with (e.g. to see why some invoices don't match rate cards for specific sites).

## Changes
- Updated \`SearchInvoices\` GraphQL query to fetch \`sites { id formattedName }\`
- Added \"Site\" column header between \"Type\" and \"Matched PO\"
- Display comma-separated site names per row (or \"-\" if none)
- Added empty summary row cell for proper column alignment
- Regenerated GraphQL types

## Screenshot
![Site column in invoice table](/opt/cursor/artifacts/screenshot_invoice_table_site_column.webp)" 2>&1

Warning: 1 uncommitted change
pull request create failed: GraphQL: Resource not accessible by integration (createPullRequest)

Once I manually access that agent run, I think some trigger happens, and the hardcoded PR creation happens. But it’s missing the full message that was created + the artifact (this is what I really care about!).

How do I fix this?

Steps to Reproduce

I just kick off an agent run from Linear, don’t touch anything, and let it run. It consistently errors at this step.

Operating System

MacOS

Version Information

I’m doing this through the web app - cursor.com/agents

For AI issues: which model did you use?

Opus 4.6 High

For AI issues: add Request ID with privacy disabled

ID: bc-58a4e45f-d30b-43fa-9b57-18a46f4377ec

Does this stop you from using Cursor

Yes - Cursor is unusable

1 Like

Hey, this is a known issue. The installation token the agent gets in the sandbox doesn’t include write access for pull requests, even if the GitHub app permissions are set correctly. We’ve seen the same Resource not accessible by integration (createPullRequest) error for several users.

Related reports:

The team is aware and tracking it. We don’t have an ETA yet, but your report helps us prioritize this, especially since it’s consistent and reproducible.

Workaround for now: after the agent finishes, it should share a link so you can create the PR manually. The branch and commits will be there, you just need to open the PR yourself. I know it’s not ideal since you lose the full PR text and any artifacts the agent prepared.

I appreciate the prompt response and help! It’s quite frustrating to not have an ETA, especially since this exact thing is one of the largest features touted in the announcement of Cursor Agents. How did ya’ll get this to work internally?

I’ve just hit this issue (again) trying out Automations. Not being able to write to GitHub from Automations makes them pretty much useless. Curious to know how the Cursor team, or others, are resolving this.

1 Like