Could not resolve default branch when creating Cloud Agent Environment (private personal repo)

Where does the bug appear (feature/product)?

  • Background Agent (GitHub, Slack, Web, Linear)
    ※ Cloud Agents dashboard → Create a New Environment

Describe the Bug

When I try to create a new Cloud Agent Environment for a private repository on my personal GitHub account, the setup fails immediately with:

“Could not resolve default branch”

The failure happens before any agent run starts. I never get past Create a New Environment → Start Agent. No agent is created and there is no Request ID in the agents URL.

This is not a local Git issue: GitHub API and gh CLI both confirm the default branch main exists with commits.


Steps to Reproduce

  1. Ensure Cursor GitHub App is installed on my personal account with All repositories access
  2. Go to Cloud Agents dashboard → New Environment
  3. Select my private repo from the list (not typed manually)
  4. Click Start Agent
  5. Error appears immediately: Could not resolve default branch

Expected Behavior

Cursor should resolve main as the default branch and proceed with environment onboarding (~20 min setup).


Screenshots / Screen Recordings


Operating System

  • MacOS

For AI issues: which model did you use?

N/A — this occurs during Environment setup, before any model/agent run.


For AI issues: add Request ID with privacy disabled

No Request ID available — setup fails before an agent run is created.


Additional Information

Already ruled out (standard Git causes):

  • Empty repository / no initial commit
  • Missing main on remote
  • main vs master mismatch
  • gh api confirms default_branch: main and branch exists with commits

Already tried:

  • Disconnect / reconnect GitHub in Cursor Integrations
  • Uninstall and reinstall Cursor GitHub App (personal account, All repositories)
  • Multiple retries over several hours (error is consistent, not intermittent)
  • Confirmed Pro plan

Suspected cause: Stale or mismatched GitHub App installation ID on Cursor’s backend (similar to other forum reports).

Workaround: Using local Cursor Agent + GitHub Actions for now. Cloud Environment setup remains blocked.

Related threads:

I can share repo details privately with the team if needed.

Hi there!

We detected that this may be a bug report, so we’ve moved your post to the Bug Reports category.

To help us investigate and fix this faster, could you edit your original post to include the details from the template below?

Bug Report Template - Click to expand

Where does the bug appear (feature/product)?

  • Cursor IDE
  • Cursor CLI
  • Background Agent (GitHub, Slack, Web, Linear)
  • BugBot
  • Somewhere else…

Describe the Bug
A clear and concise description of what the bug is.


Steps to Reproduce
How can you reproduce this bug? We have a much better chance at fixing issues if we can reproduce them!


Expected Behavior
What is meant to happen here that isn’t working correctly?


Screenshots / Screen Recordings
If applicable, attach images or videos (.jpg, .png, .gif, .mp4, .mov)


Operating System

  • Windows 10/11
  • MacOS
  • Linux

Version Information

  • For Cursor IDE: Menu → About Cursor → Copy
  • For Cursor CLI: Run agent about in your terminal
IDE:
Version: 2.xx.x
VSCode Version: 1.105.1
Commit: ......

CLI:
CLI Version 2026.01.17-d239e66

For AI issues: which model did you use?
Model name (e.g., Sonnet 4, Tab…)


For AI issues: add Request ID with privacy disabled
Request ID: f9a7046a-279b-47e5-ab48-6e8dc12daba1
For Background Agent issues, also post the ID: bc-…


Additional Information
Add any other context about the problem here.


Does this stop you from using Cursor?

  • Yes - Cursor is unusable
  • Sometimes - I can sometimes use Cursor
  • No - Cursor works, but with this issue

The more details you provide, the easier it is for us to reproduce and fix the issue. Thanks!

when will this bug being resolved?

I have the same issue, but with Linux.

still having this issue

here is the network response when launching a cloud agent.

reconnecting cursor with GitHub Org did not solve the problem

{
    "error": {
        "message": "Error",
        "details": [
            {
                "error": "ERROR_GITHUB_APP_NO_ACCESS",
                "details": {
                    "title": "Failed to get GitHub installation for {{org}}/{{repo}}",
                    "detail": "An unknown GitHub error occurred while fetching installation details.",
                    "additionalInfo": {
                        "scmProvider": "github",
                        "scmFailureReason": "repo_not_accessible"
                    },
                    "buttons": [],
                    "planChoices": []
                },
                "isExpected": true
            }
        ]
    }
}

I had this issue as well but it started working after I switched privacy mode from the legacy privacy mode to the regular privacy mode.