Skip to content

plan mode: prompt attempts workspace edits despite denied edit permission #37394

Closed as not planned

Description

@billyhawkes

Summary

In plan mode, entering a prompt can cause opencode to attempt writing or applying changes to workspace files. When edit permission is denied, the request fails instead of remaining read-only or asking for permission appropriately.

Environment

  • opencode version: 1.17.18
  • OS: Darwin 25.5.0 (Darwin 25.5.0, arm64)
  • Terminal: Ghostty, TERM=xterm-256color, COLORTERM=truecolor
  • Shell: /bin/zsh
  • Install/channel: Unavailable: executable output did not identify the install channel
  • Active plugins: None configured in the inspected project and user configs; the previously listed /Users/billyhawkes/Projects/211-search/tmp/luna-fix.ts file was not present when inspected

Reproduction

  1. Start opencode in plan mode.
  2. Enter a prompt that causes the session to produce or apply a workspace change.
  3. Observe the resulting permission error.

Expected Behavior

Plan mode should not write to workspace files. It should either keep the proposed changes in the plan/session view or explicitly request edit permission before attempting a file operation.

Actual Behavior

The prompt causes opencode to attempt to write to files. The operation fails with:

# Patch failed
Permission denied: edit
I can’t apply the session view because workspace edit permission was denied twice before any files were changed.

Additional Context

The failure was observed while entering a prompt in plan mode. No files were changed because edit permission was denied twice. Reproduction frequency, the exact prompt, and whether the issue occurs in every workspace are not yet confirmed.

Activity

  1. github-actions commented on Jul 16, 2026

    @github-actions
    Contributor

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

    If your issue is specifically about the permission-denied error message behavior (rather than the enforcement gap itself), it may still be worth keeping open, but please check the above issues first.

  2. github-actions commented on Sep 15, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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