Agent cannot run gh merge/write commands (no approval card, command returns unknown/no-exit-status)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In Agent mode, read-only gh commands work, but write gh commands fail with an internal runner behavior (“unknown / no exit status”). No approval card appears, so the action cannot be approved/executed from chat.

Steps to Reproduce

  1. In Agent mode, run:
gh pr view <pr-number> --json state,mergedAt,url
  1. Then run either:
gh pr merge <pr-number> --merge --delete-branch
gh api -X PUT repos/<owner>/<repo>/pulls/<pr-number>/merge -f merge_method=merge
  1. Observe command behavior and chat UI:
    • Write command does not return a normal status in agent runtime (unknown/no-exit-status behavior).
    • No approval card appears.
    • PR remains open.
    • Read command still succeeds and reports PR still open.

Expected Behavior

Merge succeeds, or Cursor shows an approval card if approval is required.

Operating System

Linux

Version Information

Cursor Version: 3.9.8 (Stable, Release Track: Default)
Layout: glass
VS Code Extension API: 1.105.1
Commit: 4aa8ff1b7877ed7bd01bcba308698f71a6735380
Date: 2026-06-25T01:39:30.490Z
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Ubuntu 26.04 LTS (kernel 7.0.0-27-generic, x64)

Additional Information

  • PR was mergeable and checks were green.
  • Reproduced across multiple attempts, including from a shell subagent path.
  • Related forum threads about missing approval UI exist, but this report focuses on the gh write-command failure path in Agent mode.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. “no exit status” here means the command result is unknown, so the agent shouldn’t assume the merge happened. That’s why the follow-up read correctly shows the PR is still open, the command most likely didn’t run at all.

This looks like Auto-Run behavior in Sandbox mode. On Linux, when running in sandbox, write or network commands can fail at the exec step, and you don’t get the fallback approval card. Read commands work because they only need the read-only sandbox.

Quick workaround: Settings → Agents → Auto-Run: switch from “Sandbox” to “Use Allowlist”, or enable Legacy Terminal Tool. Then write commands will run outside the sandbox and should show the approval card.

To confirm the exact mechanism, can you share:

  1. What Auto-Run mode are you using right now, and is Sandbox enabled?
  2. Does switching to “Use Allowlist” fix it?

Let me know how it goes.

Thanks for the explanation. It matches what I saw: read-only gh pr view worked, but merge/write commands returned unknown/no-exit-status and the PR stayed open, with no approval card.

1. Auto-Run mode: I’m currently using Auto-review (with sandbox)

2. Workaround test: I’ll switch to Allowlist and retry.

I’ll report back whether write commands run and whether the approval card appears.

Yeah, Auto-review with sandbox fits this issue. Write and network commands like gh pr merge run in the sandbox and fail at the exec step, and the fallback to an approval card doesn’t trigger in this mode. Read commands work because they only need the read-only sandbox.

Switching to Use Allowlist should bring back the approval card and run the commands outside the sandbox. Let me know if the workaround helped. If not, I can share what other details to collect, like the Request ID and logs, and we’ll dig in further.