Where does the bug appear (feature/product)?
Cloud Agent (GitHub, Slack, Web, Linear)
Describe the Bug
I am building a tool based on the SDK. I have been creating Cloud Agents for about 2 weeks with my tool and nothing has changed. I was checking in code and merging last night into my BitBucket repos. Today I tried to spin up a cloud agent and I got the error “[validation_error] Failed to verify existence of branch ‘Dev’ in repository (my repo). Please ensure the branch name is correct.”
I have verified.. it is there. I can see it in BitBucket, I can check in code to it locally. It cannot see Master or Dev. I tried revoking and re-connecting the OAuth for BitBucket inside Cursor and Bitbucket.
Here is info from Cursor for troubleshooting.
Cloud agents fail to start on private Bitbucket Cloud repos even though Integrations shows Bitbucket as Connected.
Reproduction (@cursor/sdk, same as our production worker):
- API key valid: GET (removed due to post link limits) → 200
- Agent.create with cloud.repos:
{ “url”: “(removed due to post link limits)”, “startingRef”: “Dev” } - agent.send(“Reply OK”) fails in ~300–1000ms:
[validation_error] Failed to verify existence of branch ‘Dev’ in repository (removed due to post link limits). Please ensure the branch name is correct.
Same error for startingRef “master” and “main” on the same repo.
Affected repos (all fail the same way)
Bitbucket Integrations UI shows Connected for the same Cursor account that owns API key crsr_835… (full key available privately).
Separately, our Atlassian API token can list branches via Bitbucket REST API (Dev and master both exist). Taskmaster merges/branch lists work. Only Cursor’s branch verification on send() fails.
Cursor.repositories.list() returns 0 repos. No active bc-* agents to resume — every job needs a fresh create.
This worked for ~2 weeks with no config changes on our side.
Steps to Reproduce
-
On cursor.com → Integrations, connect Bitbucket Cloud for the same Cursor account that owns the API key (dashboard shows “Connected”).
-
Confirm the API key works:
GET (removed due to post link limits)
Authorization: Basic <API_KEY>:
→ HTTP 200 -
Create a Cloud agent via @cursor/sdk (or POST):
const agent = await Agent.create({
apiKey: “<API_KEY>”,
model: { id: “auto” },
cloud: {
skipReviewerRequest: true,
autoCreatePR: false,
workOnCurrentBranch: false,
repos: [{
url: “(removed due to post link limits)”,
startingRef: “Dev”
}]
}
}); -
Send a minimal prompt:
await agent.send(“Reply OK”);
-
Observe immediate failure (~300–1000ms):
[validation_error] Failed to verify existence of branch ‘Dev’ in repository. Please ensure the branch name is correct.
-
Repeat step 3–5 with startingRef “master” and “main” on the same repo → same error.
-
(Optional UI repro) Open (removed due to post link limits), select Bitbucket repo triadicsoftware/taskmaster-api, and check whether branch dropdown lists Dev/master or fails similarly.
-
(Proves branches exist outside Cursor) With a separate Atlassian API token (not passed to Cursor):
GET (removed due to post link limits)
GET (removed due to post link limits)
→ both return 200; branches exist on Bitbucket.
Expected Behavior
With Bitbucket Connected on the same Cursor account as the API key, Agent.create + send() with repos and startingRef “Dev” should verify the branch and start the Cloud VM.
At minimum, agents should list branches for repo (Dev, master).
Screenshots / Screen Recordings
Operating System
Other
Version Information
Reproduction path: Cloud Agent via @cursor/sdk (HTTP API), not Cursor IDE or CLI.
SDK:
@cursor/sdk ^1.0.5
Node.js v22.x
API:
GET (removed due to post link limits) → 200 OK
Agent.create + send() with cloud.repos + startingRef
Cloud runtime:
Bitbucket Cloud (bitbucket.org)
Workspace: triadicsoftware
Example repo: (removed due to post link limits)
startingRef: Dev (also fails for master, main)
Model: auto
Client OS not relevant — same validation_error from Linux production worker using the same API key and payload. Failure occurs server-side on send() branch verification before any Cloud VM boots.
Cursor IDE / CLI version: N/A (not used for reproduction)
For AI issues: which model did you use?
auto (model: { id: “auto” })
For AI issues: add Request ID with privacy disabled
N/A — failure occurs on send() before a meaningful agent run completes (validation_error on branch verify). No stable run ID to attach.
Additional Information
Related threads:
- (removed due to post link limits)/cloud-agents-cant-get-branches-from-bitbucket-repo/169511
- (removed due to post link limits)/validation-error-failed-to-verify-existence-of-branch-main-in-repository-foo-bar-repo-git-please-ensure-the-branch-name-is-correct/163842
Bitbucket REST (our separate Atlassian token, NOT passed to Cursor):
GET (removed due to post link limits)refs/branches/Dev → OK
GET (removed due to post link limits)refs/branches/master → OK
Cursor SDK payload:
repos: [{ url: “(removed due to post link limits)”, startingRef: “Dev” }]
skipReviewerRequest: true, autoCreatePR: false, workOnCurrentBranch: false
Repos are private; URL format is standard clone URL without /branch/Dev in the path.
Does this stop you from using Cursor
Yes - Cursor is unusable


