When using the Cursor Cloud Agent API, the agent creates its own branch when we specify the branch that the agent must push in the payload. It is not doing this always but, but even if this happens, it will break our system. Instead of pushing to draft it is commmitting to /tree/cursor/ubicaci-n-madrid-espa-a-a107
Steps to Reproduce
Use /launch_agent endpoint with this parameters:
[CursorAgent] Request body: {
“prompt”: {
"text": "# SYSTEM INSTRUCTIONS\n## Role\nYou are a code generation agent for \"Project 1 \" (nextjs).\n\n## Language + Scope\n- Use the user’s language for ALL user-facing text.\n- Change ONLY what the user asked to change.\n\n## Rules\n- Branch you MUST commit/push is 'draft'. Do not create your own branches.\n- No Payload CMS imports.\n- No hardcoded English (match user language).\n- No duplicate data-cm-id.\n- No placeholder/example external image URLs.\n\n---\n\n---\n\n## USER REQUEST\n\ncambia \"Madrid, Comunidad de Madrid\" a \"Madrid, Comunidad de Madrid, espana\""
},
“source”: {
"repository": "my_repo",
"ref": "main"
},
“target”: {
"branchName": "draft",
"autoCreatePr": false
},
“model”: “composer-1.5”
}
Expected Behavior
The edited code from the agent must be committed to the draft branch
Operating System
MacOS
Version Information
Cursor Cloud Agent API
For AI issues: which model did you use?
composer-1.5, but the same for other models in the list.
For AI issues: add Request ID with privacy disabled
Hey, thanks for the report. The payload looks correct based on the docs. With autoBranch: true by default, branchName: "draft" should create a branch with that exact name.
Could having already a branch called draft be an issue for the agent because the **target.branch** is seeing there is already a branch “draft“ and creating its own branch. (which used to be working, now not)
That’s a reasonable hypothesis, but based on other users’ reports, the issue happens regardless of whether the branch exists or not. In the related thread, even brand new branch names are ignored, and the API generates its own branch name instead of using the provided branchName.
Hi Cursor Team,
I’m still facing the same problem, when launching the agent with particular custom branch but It is not pushing in the right branch rather it’s creating new branch. Please fix this up asap..
I found a workaround that would kind of solve this issue. If you are trying to specify the branch for the agent to work on, and still not functioning. When the agent finishes working, it returns the information about the branch it works on. Such as sha id of the commit, so you know what the agent has committed. You can just copy the last commit to your target branch manually within your code. Not as convenient as Cursor pushing automatically, however will work until the team fixes the bug.