Failed to gather Agent Review context

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Error message keeps appearing

Failed to gather Agent Review context. Caused by: no branches available in local repository

Steps to Reproduce

Finalize a request in agent mode

Expected Behavior

no error message

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.8 (Universal)
VSCode Version: 1.105.1
Commit: acdb5a1ab634f13d3d9381161dcb9603f184e670
Date: 2025-12-10T07:03:58.386Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 23.4.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

bug also present in

Version: 2.2.14 (Universal)
VSCode Version: 1.105.1
Commit: 1685afce45886aa5579025ac7e077fc3d4369c50
Date: 2025-12-11T01:12:35.790Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 23.4.0

Hey, thanks for the report. This is a known issue already escalated to engineering: Agent Review sometimes fails with ‘Failed to gather context’ error

To add your case to the investigation, could you share:

  1. The output of git branch -a from your repo’s terminal
  2. Whether you have a local main (or master) branch and whether it exists on the remote

Temporary workaround: the “Review Changes” feature inside the Agent chat should work for reviewing the Agent’s changes.

Are other Cursor features working normally?

1 Like

thanks!

git branch -a

jonas@Air-Jonas app % git branch -a
16183e28cce9163fd706e7d04583f62f0467c9a4
current-state

  • gm
    main
    remotes/origin/HEAD → origin/main
    remotes/origin/current-state
    remotes/origin/gm
    remotes/origin/main
    remotes/origin/si
    remotes/origin/test
    remotes/origin/tgm
    jonas@Air-Jonas app %

I have a main branch but only remote

Cursor works great otherwise

This may be relevant. In my case I am opening cursor in /my-non-git-tracked-folder.
this folder contains two GIT tracked subfolders: /backend and /frontend.
When committing changes to /backend or /frontend(two separate repositories), I get this error.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.