[Bug] GitHub PR Manager fails in SSH remote sessions: gh spawned locally instead of over RemoteProcess
Bug Description
▎ Title: Desktop CI monitoring fails in SSH remote sessions — gh is run locally, not over SSH
▎
▎ Summary: In a desktop SSH session to a remote host, the PR/CI monitor shows "CI checks unavailable — Failed to
▎ spawn /opt/homebrew/bin/gh: spawn /opt/homebrew/bin/gh ENOENT", even though gh is installed and authenticated on
▎ both machines.
▎
▎ Root cause traced: git calls are tunneled over SSH (logged as [RemoteProcess] Spawning: git …, and they succeed).
▎ But [GitHubPrManager] spawns gh as a local child process on the laptop (stack trace in
▎ /Applications/Claude.app/...), with cwd set to the remote repo/worktree path, which doesn't exist locally. Node
▎ reports a missing cwd as spawn <command> ENOENT, so the binary gets blamed. Zero gh calls are routed through
▎ RemoteProcess. Reproduced: spawn('/opt/homebrew/bin/gh', …, {cwd: <nonexistent>}) → identical error; valid cwd
▎ works.
▎
▎ Ask: Route gh through the same SSH RemoteProcess channel as git (remote gh binary, remote cwd, login-shell PATH —
▎ the remote non-interactive PATH is bare /usr/bin:/bin:/usr/sbin:/sbin).
▎
▎ Evidence: ~/Library/Logs/Claude/main.log — [GitHubPrManager] … ENOENT repeating every ~5 min since 2026-05-13.
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.156
- Feedback ID: 93c2e892-55c0-449e-b5d9-ee24158198dc
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗