Skip to content

[Bug] Commands auto-executed in plan mode without approval #29955

@nuigurumikono

Description

@nuigurumikono

Description

[BUG] AI agent executes commands automatically in Plan Mode without approval.

Description

There is a critical security/logic flaw where the AI agent completely ignores the Plan mode constraint and directly executes bash/system commands (such as starting/stopping local processes) without waiting for user approval.

Steps to Reproduce

  1. Enter Plan mode.
  2. The user inputs a prompt that implies a system action (e.g., "Open Discord").
  3. The AI suggests a plan, but simultaneously issues and runs the PowerShell/Bash commands underneath to kill and restart the application.
  4. The application actually opens/closes on the local machine, meaning the tool bypassed the confirmation barrier entirely.

Actual Behavior

Even though the UI/Session shows it is in Plan mode, the backend executes the generated code/commands automatically.

Expected Behavior

In Plan mode, the agent MUST ONLY generate the plan and stop. It should never execute any code or commands until the user explicitly toggles to an execution mode or approves the action.

Environment Context

  • Repository: anomalyco/opencode
  • OS: Windows / macOS
  • Mode: Plan Mode
      

windwos11 pro opencode install from npm

Plugins

No response

OpenCode version

1.15.12

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

windwos11 26200.8457

Terminal

windos terminal

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions