Repository navigation
Description
Summary
A global shell permission rule with effect: "ask" never prompts in OpenCode Desktop: the command executes immediately with zero server-side wait (tool span ~41ms), implying the Desktop client replies "allow" instantly without rendering any approval UI. The same engine version (2.0.27) running standalone with the TUI prompts correctly ("Permission required" with Allow once / Always allow / Reject), so the engine's ask path works and the failure is Desktop-client-specific — effectively a silent auto-approve, which is security-relevant.
Environment
- opencode version: Desktop 2.0.27 (engine: bundled
cli/2.0.27/opencode-cli serve --service); TUI test also run with the same bundled 2.0.27 binary via--standalone; PATH CLI v2.0.26 - OS: Darwin 25.5.0 (macOS, arm64)
- Terminal: OpenCode Desktop app (failure environment); WarpTerminal (TUI isolation test)
- Shell: /bin/zsh
- Install/channel: release / latest
- Active plugins: no
pluginsfield in any config; custom file~/.config/opencode/plugins/tdai-memory.tsexists on disk (load status undetermined, likely not loaded)
Reproduction
-
Write the global config
~/.config/opencode/opencode.jsonc:{ "$schema": "https://opencode.ai/config.json", "permissions": [ { "action": "shell", "resource": "git push *", "effect": "ask" } ] } -
Restart the shared background service (
opencode service restart); confirm the rule viaopencode api get /api/config. -
Open a new Desktop session in any git repository and instruct the agent: "Do not analyze. Directly execute
git pushwith the shell tool and paste the raw output." -
Observe: the command runs immediately, no approval card appears, and
GET /api/session/{id}/permissionshows no pending request around the execution. -
Isolation test: run the same config and instruction in a fresh standalone TUI —
"$HOME/Library/Application Support/ai.opencode.desktop/cli/2.0.27/opencode-cli" --standalone— same repo, same prompt text. -
Control: change
effectto"deny", restart the shared service, repeat step 3.
Expected Behavior
With ask, the shell tool call should block until the client replies; the Desktop app should show an approval card equivalent to the TUI's "Permission required" prompt.
Actual Behavior
Desktop + ask: the server spawns the process immediately (log: spawning process command=/bin/zsh args=["-c","git push"]; the tool's HTTP span was ~41ms — no wait at all). No permission request event or reply is recorded in server logs. No card appears anywhere in the Desktop UI. Reproduced 3/3 times, including once after a full service restart with the rule confirmed loaded via /api/config.
TUI + ask (same 2.0.27 engine, standalone): prompts correctly — "Permission required" with Allow once / Always allow / Reject.
Desktop + deny (same rule shape): correctly blocked with {"error":{"type":"permission.rejected","message":"Permission denied: shell"}}.
Additional Context
- The zero-wait spawn implies the Desktop client returns an allow reply immediately (or the request never reaches the UI layer), rather than the card merely failing to render.
- Config verified loaded post-restart via
/api/config— not a stale-config issue. - No client-side auto-approve setting found in Desktop
opencode.settingsor Local Storage (no approval-related keys). - No session-level overrides: repro sessions show
agent=buildand emptysession_v2.permission. - No saved
shellapprovals in thepermissionDB table (only two oldexternal_directoryallows). - V1-era approval flow worked: those
external_directory"Allow always" rows were created on 2026-10-08 under V1 CLI 1.18.35. - Related issues: Notification permission is not requested with New layout enabled #37120 (Desktop approval notification with New layout), [Desktop] 'Always Allow' permission selection not respected - acts like 'Allow Once' and resets immediately #37880 (Desktop "Always Allow" not respected).
- Frequency: 3/3 consistent on Desktop; TUI prompted 1/1.
- Workaround in use: falling back to
effect: "deny", which blocks all agent pushes instead of asking — no way to get ask-based approval on Desktop until fixed.
Activity
opencode-agent commentedon Oct 12, 2026
Thanks for the detailed report and the deny/TUI isolation tests, they narrow this down a lot.
I couldn't reproduce this here: it happens in the Desktop app on macOS, and our automated sandbox can only run the CLI/TUI. Your tests already show the 2.0.27 engine prompts correctly in the TUI, so a maintainer with the Desktop app will need to look at this.
One thing worth checking in the meantime: Desktop has a client-side Auto-accept permissions setting (Settings → General, also toggled with
Cmd+Shift+A). While it is on, Desktop answers every permission request with "allow once" straight away and hides the approval card. That would match the instant, card-less execution you saw. It is stored in the app's own settings, not inopencode.jsonc. Could you check whether it is enabled, and whether turning it off makes theaskcard appear?Related issues:
askrules on MCP tools silently becameallowon Desktop (2.0.18)samvallad33 commentedon Oct 20, 2026
Hi SearchUpon,
Did git push really go out with no approval card even though your ask rule was loaded?
I hit the same kind of problem where an agent kept running a command it had been allowed once. If that is what happened on your end, would you want to see something combining memory, authority, and security so every shell command gets checked before it runs and a push only goes through on a one-use permit?
If you want to give it a spin, it is a single line:
npx @vestige/init
For a setup like yours it checks each push before it runs, asks for a fresh one-use permit, and writes a hash-chained receipt of the decision, so a silent approval shows up right away instead of slipping past.
Sam