Skip to content

[BUG] Always permission scope depends on request timing #46357

Description

@samiralibabic

Description

Selecting Always stores an approval rule in the instance-wide approved list, so future matching requests in any session are automatically allowed. However, requests that are already pending are reconsidered only when they belong to the session where Always was selected.

This makes identical requests behave differently solely because of timing: a matching request created before the approval can remain blocked in another session, while the same request created afterward is automatically approved there.

The approval scope should be consistent for pending and future requests. The safe scope also needs to be explicit, for example the originating session tree rather than every unrelated concurrent session.

Related: #42310 deliberately avoids approving requests from unrelated sessions in the run client.

Plugins

None required

OpenCode version

1.18.25 and current dev

Steps to reproduce

  1. Open two sessions in the same OpenCode instance with the same permission set to ask.
  2. Make a matching request pending in session B.
  3. Make the same request in session A and select Always.
  4. Observe that the existing request in B remains pending.
  5. Repeat with the request in B created after selecting Always in A.
  6. Observe that the later request in B is automatically approved.

Screenshot and/or share link

Not applicable

Operating System

macOS 26.6.2

Terminal

Not terminal-specific

Activity

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