cli / cli/cli

Unable to use `gh pr view --web` when sandbox (Docker sbx) remote exists

Open
#14,046 3 comments 0 reactions 0 assignees View on GitHub
bug priority-3 stale
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### Describe the bug

I'm using Docker sbx in `--clone` mode, which adds a sandbox related remote…

```
$ git remote -v
origin git@github.com:MyOrg/my-project.git (fetch)
origin git@github.com:MyOrg/my-project.git (push)
sandbox-claude-my-project git://127.0.0.1:49154/my-project (fetch)
sandbox-claude-my-project git://127.0.0.1:49154/my-project (push)
```

When I run `gh pr view --web`, rather than open the PR I get error…
```
could not resolve remote "sandbox-claude-my-project": no matching remote found
```

### Affected version

```
gh version 2.96.0 (2026-07-02)
https://github.com/cli/cli/releases/tag/v2.96.0
```

### Steps to reproduce the behavior

1. Create a Docker sandbox in clone mode `sbx run --clone claude .`
2. In Claude, create a new branch and commit some changes
3. Checkout the sandbox branch on the host (while the Sandbox is still running as the remote drops shortly after it's stopped) - `git fetch {sandboxName} && git checkout {branchName}`
4. Push to (Github) origin `git push origin {branchName}`
5. Set the branch to track origin `git branch --set-upstream origin/{branchName} {branchName}`
6. Create a PR from the branch
7. Run `gh pr view --web`

### Expected vs actual behavior

I expected this to open the PR in a browser. but it displayed the error 'could not resolve remote "sandbox-claude-my-project": no matching remote found'.

### Logs

```
$ gh pr view --web
could not resolve remote "sandbox-claude-my-project": no matching remote found
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with `gh pr view --web` in a repository containing the sandbox remote shown in the issue, then trace the `gh pr view` remote-resolution entry point. The work is done when the command opens the GitHub PR using the tracked origin despite the extra sandbox remote, with coverage for this setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github, go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.