Repository navigation
Description
Description
I run OpenCode for autonomous, multi-step coding tasks (think: 30–60 min agent runs where I walk away). The auto-approve toggle is exactly what I need in theory — but in practice it silently breaks during a long run, and the agent stalls on a permission prompt that I never see. I burned 60 minutes on a run before I caught it.
This looks like it overlaps with three existing reports (#27487, #20998, #31137) but those each cover a single piece. The user-visible shape is the same in all of them: "I asked for auto-approve, OpenCode still asked me."
Steps to reproduce
- Open OpenCode Desktop (or Web UI).
- Settings → General → turn ON Auto-accept permissions (the same toggle as the
command.permissions.autoaccept.enablei18n key, surfaced inpackages/app/src/components/settings-general.tsx:320andpackages/app/src/components/settings-v2/general.tsx:76). - Open a session and kick off a long autonomous task (e.g. a multi-file refactor, or anything that touches >1 tool that would normally prompt).
- Walk away (this is the point — autonomous).
- Wait. Depending on which surface you're on, one of:
- Page refresh / app restart → toggle resets to OFF ([Bug] Auto-approve permissions toggle resets to OFF after restart #27487)
- "New project" layout → toggle is disabled / not associated ([Web UI] "Auto-accept permissions" button is disabled when "New layout and design" is enabled. #31137)
- Background page while server-side task is running → pending permission requests never auto-accept (fix(app): pending permissions are not auto-accepted after page refresh #20998)
- Per-session toggle was removed in v1.4.0 ([FEATURE]: Restore per-session auto-accept permissions toggle in Desktop UI #21578) so you can't re-grant it mid-run
- Agent blocks on a permission prompt. You don't see it. Task sits idle.
Expected
For an autonomous run, the auto-approve decision should be sticky and authoritative for the duration of the session — i.e. once granted (globally or per-session), it survives restarts, page refreshes, and "new project" layout transitions until I explicitly turn it off.
What I checked in the code
- The
--autoflag already exists on bothtuiandruncommands (packages/opencode/src/cli/cmd/tui.ts:108andpackages/opencode/src/cli/cmd/run.ts:244) but is documented as"dangerous!"and not surfaced in the Desktop/Web UI as a one-click equivalent for non-CLI users. - The Web UI toggle is wired through
data-action="settings-auto-accept-permissions"(packages/app/src/components/settings-general.tsx:323,settings-v2/general.tsx:79) and an e2e regression test exists atpackages/app/e2e/regression/remote-session-settings.spec.ts— so the team clearly cares about this code path, but the persistence story is fragmented.
Related issues (please cross-link / merge if appropriate)
- [Bug] Auto-approve permissions toggle resets to OFF after restart #27487 — auto-approve resets to OFF after restart
- fix(app): pending permissions are not auto-accepted after page refresh #20998 — pending permissions not auto-accepted after page refresh
- [Web UI] "Auto-accept permissions" button is disabled when "New layout and design" is enabled. #31137 — auto-accept disabled in new project layout
- [FEATURE]: Restore per-session auto-accept permissions toggle in Desktop UI #21578 — per-session auto-accept was removed in v1.4.0
Suggested fix direction
- Make the auto-approve decision a first-class persisted session/workspace config (not a UI-only toggle).
- Reconcile the three surfaces (CLI
--auto, Desktop settings, Web UI settings) so they read/write the same source of truth. - On session boot, replay any pending permission requests against the persisted decision instead of waiting for fresh user input.
- Re-introduce a per-session override (the v1.4.0 regression) for users who want strict mode inside an otherwise permissive workspace.
Environment
- OpenCode version: latest (please add the exact version you're on)
- OS: (please fill in)
- Terminal: N/A (Desktop/Web UI repro)
- Plugins: none
Screenshot / share link
I'll attach /share output in the issue.
Activity
github-actions commentedon Sep 25, 2026
This issue might be a duplicate of existing issues. Please check:
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊