Skip to content

[Bug] Auto-approve permissions is not sticky for long autonomous runs — agent stalls on permission prompt without the user noticing #51398

Closed as not planned

Description

@mrvigneshvt

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

  1. Open OpenCode Desktop (or Web UI).
  2. Settings → General → turn ON Auto-accept permissions (the same toggle as the command.permissions.autoaccept.enable i18n key, surfaced in packages/app/src/components/settings-general.tsx:320 and packages/app/src/components/settings-v2/general.tsx:76).
  3. 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).
  4. Walk away (this is the point — autonomous).
  5. Wait. Depending on which surface you're on, one of:
  6. 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 --auto flag already exists on both tui and run commands (packages/opencode/src/cli/cmd/tui.ts:108 and packages/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 at packages/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)

Suggested fix direction

  1. Make the auto-approve decision a first-class persisted session/workspace config (not a UI-only toggle).
  2. Reconcile the three surfaces (CLI --auto, Desktop settings, Web UI settings) so they read/write the same source of truth.
  3. On session boot, replay any pending permission requests against the persisted decision instead of waiting for fresh user input.
  4. 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

  1. github-actions commented on Sep 25, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions