Skip to content

[FEATURE]: Wire the permission.ask plugin hook #22311

@jbro

Description

@jbro

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The tool.execute.before hook can inspect and mutate tool args, or block execution by throwing, but it can't defer to the user for approval.

Without this, plugins that implement policy engines have no way to do "stop and ask", only hard-block or silent-allow.

Plugin-defined tools already get ask() via ToolContext, so the precedent exists.

The fix is small: pass ask on the hook's input object at the three trigger sites in prompt.ts, and extend the type in packages/plugin/src/index.ts.

Related to #19469 and #7006 but distinct, those wire the permission.ask hook to intercept existing permission checks; this exposes ask() on tool.execute.before so plugins can initiate permission requests.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

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