Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Environment:
- OS: macOS
- Workspace: Multi-root workspace (
.code-workspace)
Directory Structure Background:
I have a project management directory that contains multiple independent Git repositories
(backend, frontend, docs, etc.). The parent directory is also a Git repo to centrally
manage shared configuration files (IDE settings, CI configs, documentation).
project-root/ ← Git repo A (for shared configs)
├── .cursor/ ← Shared IDE settings
├── .vscode/
├── backend/ ← Git repo B (main codebase)
│ └── .git/worktrees/
├── frontend/ ← Git repo C
└── worktrees/
└── feature-branch/ ← Worktree of Git repo B
I use Git worktrees under worktrees/ for parallel feature development on backend/.
Problem:
When committing in a Git worktree, Agent Review fails with:
Failed to gather Agent Review context.
Caused by: Error when executing ‘git’: fatal: Not a valid commit name
Root Cause:
Agent Review appears to run git from the workspace root (project-root/)
instead of the worktree’s actual Git context.
The commit hash exists in the worktree’s repo (Git repo B) but not in
the parent directory’s repo (Git repo A), causing the lookup to fail.
Workaround:
Disable “Auto-run on commit” for Agent Review.
Steps to Reproduce
- Open a multi-root workspace containing nested Git repos
- Create a worktree from one of the sub-repos
- Open the worktree folder in the workspace
- Make changes and commit
- Agent Review automatically triggers and fails
Expected Behavior
Agent Review should detect the correct Git directory for the worktree
(by following the .git file pointer or using git rev-parse --git-dir).
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 2.3.0-pre.23.patch.0
VSCode Version: 1.105.1
Commit: c22665d06699c8ce0d3c9d347414c7501505cf70
Date: 2025-12-22T01:54:01.106Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0
Does this stop you from using Cursor
No - Cursor works, but with this issue