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
In Agent mode, run:
gh pr view <pr-number> --json state,mergedAt,url
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
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.
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:
What Auto-Run mode are you using right now, and is Sandbox enabled?
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.