Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
The ManagePullRequest tool fails to update an existing pull request when the GitHub organization/owner name differs only by letter casing between contexts.
In my repo, the git remote is configured as company-name (lowercase):
origin https://github.com/company-name/company.git
However, when the agent creates a PR with the create_pr action, the tool returns a PR URL using a different casing for the owner:
PR URL: https://github.com/Company-Name/company/pull/712
(Company-Name vs company-name).
GitHub owner/repo names are case-insensitive, so both URLs resolve to the same repository. But when the agent subsequently calls update_pr, the tool rejects the request with:
Error managing PR: PR URL must belong to the current repository
This happens both when the agent passes the pr_url returned by create_pr and when it passes only branch_name (which should resolve the PR internally without it supplying any URL). So the failing comparison appears to be an internal, case-sensitive string match between the PR’s owner/repo and the remote’s owner/repo — not something the caller can work around.
Impact: Once a PR is created, it cannot be updated (e.g., to add screenshots, edit the description, or change the base branch) for any repository whose remote URL casing doesn’t byte-for-byte match the casing GitHub/the API returns in the canonical PR URL. The PR itself is fine and viewable on GitHub; only the tool’s update path is blocked.
Steps to Reproduce
- Use a repository whose git remote owner casing differs from GitHub’s canonical casing. For example, set the remote to a lowercased owner while the GitHub org is mixed-case:
git remote set-url origin https://github.com/Company-Name/company.git
(canonical owner on GitHub: Company-Name) - Commit and push a branch.
- Call ManagePullRequest with action: create_pr (providing title, body, branch_name, base_branch). Note the returned PR URL uses the canonical casing, e.g. https://github.com/Company-Name/company/pull/.
- Call ManagePullRequest with action: update_pr, passing the pr_url from step 3 (and a new body).
- Actual: Error managing PR: PR URL must belong to the current repository
- Expected: the PR is updated.
- Retry update_pr passing only branch_name (no pr_url).
- Actual: same error.
- Expected: the PR is updated.
Expected Behavior
update_pr should treat owner/repo comparisons as case-insensitive (matching GitHub’s own semantics), so a PR created via create_pr in the same session can always be updated — whether referenced by pr_url or by branch_name.
Operating System
Linux
Version Information
Cursor Cloud Agent
For AI issues: which model did you use?
Opus 4.8
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor