Skip to content

[FEATURE]: /approve — toggle permission approval mode at runtime (on/off, per-session) #41909

Open

Description

@afonsoft

Requested feature

Add an /approve on|off slash command (inspired by Claude Code's /approve on/off) to toggle manual step-by-step permission approval at runtime, optionally per session.

Why

Permissions mode is currently fixed at startup: packages/tui/src/context/permission.tsx reads args.auto and exposes an in-memory toggle(), and the CLI only supports --auto / -y / --dangerously-skip-permissions flags (packages/opencode/src/cli/cmd/run.ts). There is no interactive command to switch between normal and auto approval mid-session.

Proposed behavior

  • /approve on sets approval mode to auto; /approve off restores manual confirmation.
  • Toggle is persisted per-session (surface in PermissionV1.Ruleset / session config) and honored by the existing permission evaluation path (packages/opencode/src/permission).

Benefits

  • Go hands-free when safe, re-enable guards when tasks become risky, without restarting.
  • Mirrors Claude's /approve on|off and the existing /yolo-style flag.

Activity

  1. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

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

    If your request is specifically about a /approve on|off slash command interface (rather than a keybind or settings toggle), please clarify how it differs from the above.

  2. thedanielmay commented on Aug 14, 2026

    @thedanielmay

    Supporting this, with a note that the gap is sharpest in the web UI, where there is currently no auto-approve control at all.

    Verified against the served web bundle (v1.18.18):

    • The web settings store exposes permissions.autoApprove with a setAutoApprove setter, but no UI component calls it (single definition, no call sites in the bundle). The TUI's command-palette item "Enable auto-approve permissions" and the --auto flag have no web equivalent.
    • opencode web accepts no --auto flag (checked --help), so a browser user cannot start in auto mode either.
    • Today the only web options are per-tool allow in Settings -> Permissions (persistent, not one-click) or "always" on individual approval dialogs (session-scoped).

    A runtime /approve on|off command fixes this cleanly across every surface, including web, where slash commands already work. Also requested: a visible auto-approve indicator in the web composer mirroring what the TUI shows (muted auto next to the agent), so the mode is never silently on.

  3. iSchoen commented on Sep 6, 2026

    @iSchoen

    Chiming in from a related issue I opened (#47579) before realizing this thread covers the same gap — closing mine as a duplicate, but two implementation notes from it seem useful here:

    1. The TUI slice is nearly free. The toggle already exists in the TUI command registry as permission.mode ("Enable/Disable auto-approve permissions", category System) — it's just palette-only because it lacks a slashName, unlike its siblings (theme.switch → /themes, model.list → /models). Adding slashName: "auto" (aliases like yolo to match the hidden --yolo flag) to the existing entry would ship the TUI portion of this without any new command surface.

    2. Keybinds have the same gap. There's no keybind action bound to the toggle, so it can't be remapped via tui.json — a permission_mode action would also serve the keybind-based request tracked in [FEATURE]: Add configurable TUI keybind for auto-approve permissions #40331.

    Re: the web UI gap @thedanielmay flagged — agreed the runtime, session-scoped approach is the right cross-surface fix; the registry note above is just the quickest TUI-only stopgap.

  4. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the suggestion! The request is a /approve on|off slash command that switches between manual approval and auto-accept while a session is running, ideally per session, so you don't need to restart with --auto.

    In the current v2 TUI, auto-accept comes from either the --auto flag or the session.permissions setting (prompt / autoaccept). That setting is global and can only be changed from the Settings dialog, so a quick per-session toggle would be new behaviour. Maintainers will consider it.

    Related issues and PRs:

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