fix(opencode-plugin): show meaningful permission patterns in web UI#274
Merged
Conversation
Replace generic patterns: ['*'] in the wrap() ask() call with tool-specific human-readable strings (e.g. 'target_phase: code', 'workflow: epcc') so the opencode web permission dialog shows useful context instead of just '*'. - Add buildPermissionPatterns(toolName, args) helper in plugin.ts - Update wrap() to use it and pass actual args as metadata - Remove redundant dead-code ask() calls from all 5 tool handlers (they were never shown since wrap() already granted always: ['*'])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
patterns: ['*']in thewrap()ask()call with tool-specific human-readable strings so the opencode web permission dialog shows useful context (e.g.target_phase: code,workflow: epcc) instead of just*buildPermissionPatterns(toolName, args)helper inplugin.tsthat maps each tool's arguments to descriptive"key: value"pattern stringsask()calls from all 5 tool handlers — they were auto-allowed bywrap()'salways: ['*']grant and never shown to the userRoot Cause
The opencode web UI (
session-permission-dock.tsx) only displaysprops.request.patterns. All tools were passingpatterns: ['*'], causing the dialog to show only*with no context about what the tool was going to do.Changes
packages/opencode-plugin/src/plugin.ts— AddbuildPermissionPatterns()helper; updatewrap()to use it and pass actualargsasmetadatapackages/opencode-plugin/src/tool-handlers/proceed-to-phase.ts— Remove redundantask()packages/opencode-plugin/src/tool-handlers/start-development.ts— Remove redundantask()packages/opencode-plugin/src/tool-handlers/conduct-review.ts— Remove redundantask()packages/opencode-plugin/src/tool-handlers/reset-development.ts— Remove redundantask()packages/opencode-plugin/src/tool-handlers/setup-project-docs.ts— Remove redundantask()