feat: Add configurable permission detail display for tool calls#636
Open
lazyskulptor wants to merge 1 commit into
Open
feat: Add configurable permission detail display for tool calls#636lazyskulptor wants to merge 1 commit into
lazyskulptor wants to merge 1 commit into
Conversation
Add support for displaying tool-specific details (like eval-elisp expressions) in permission dialogs with syntax-highlighted code fences. New features: - agent-shell-permission-detail-field-map: Maps tool titles to their rawInput field names for detail extraction - agent-shell-permission-language-map: Maps tool titles to code fence languages for syntax highlighting - Heuristic fallback: When no mapping exists, extracts the longest string value from rawInput as detail Default mappings include: - emacs_eval-elisp → expression field with elisp highlighting - org-search → match field - org-roam-search → query field - Bash → console highlighting (backward compatible) Fixes xenodium#617
Owner
|
Thanks for the PR. I'm a little worried about mering further logic (specially MCP-specific) into the permission dialog. Couldn't this be fixed by getting the MCPs to report details outside of rawInput? Maybe fix there instead? |
xenodium
added a commit
that referenced
this pull request
Jun 8, 2026
Owner
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
Add support for displaying tool-specific details (like eval-elisp expressions) in permission dialogs with syntax-highlighted code fences.
Problem
When OpenCode (or other agents) sends tool calls like
emacs_eval-elisp, the permission dialog only shows the tool title without the actual expression being evaluated. This makes it hard for users to understand what code will be executed.The previous fix (#619) addressed the timing issue of rawInput arriving late, but didn't add support for displaying the
expressionfield specifically.Solution
Introduce configurable mappings to extract and display meaningful details from rawInput:
New defcustoms
agent-shell-permission-detail-field-map: Maps tool call titles to their rawInput field namesemacs_eval-elisp→expression,org-search→match,org-roam-search→queryagent-shell-permission-language-map: Maps tool call titles to code fence languagesBash→console,emacs_eval-elisp→elispHeuristic fallback
When no mapping exists, the code extracts the longest string value (≥20 chars, not a URL) from rawInput as a fallback.
Example
Before:
After: