[PR #12489] feat(opencode): Show tool args on permission request #14238

Open
opened 2026-02-16 18:19:03 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12489

State: open
Merged: No


Fixes #12111

What does this PR do?

Please provide a description of the issue (if there is one), the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the pr.

Tool call arguments were not always very apparent in tool call approval requests through the TUI. This causes issues, as there are times when the arguments of the tool call are important for the context of if they should be approved or not.

While this information was sometimes provided in-line of the chat for primary agents, I found the subagent tool calls were completely blind in this regard. Also, it is a better UX if the user is able to see it presented in the approval selection UI.

Code is simple. Made an improved renderer for tool call args, truncating them if they are too long (or there are too many). On fullscreen, we do not do the truncation. Also added configuration values, as requested by the issue, to enable this globally or selectively on specific MCP tools.

How did you verify your code works?

Ran the TUI and tried MCP tool calls with various different datatypes. Ensured existing tool calls (e.g. read, write) were not impacted. Also verified all 3 new configuration states worked as expected.

Before (or with mcp_show_parameters==="none"):
image

After:
image

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12489 **State:** open **Merged:** No --- Fixes #12111 ### What does this PR do? Please provide a description of the issue (if there is one), the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the pr. Tool call arguments were not always very apparent in tool call approval requests through the TUI. This causes issues, as there are times when the arguments of the tool call are important for the context of if they should be approved or not. While this information was sometimes provided in-line of the chat for primary agents, I found the subagent tool calls were completely blind in this regard. Also, it is a better UX if the user is able to see it presented in the approval selection UI. Code is simple. Made an improved renderer for tool call args, truncating them if they are too long (or there are too many). On fullscreen, we do not do the truncation. Also added configuration values, as requested by the issue, to enable this globally or selectively on specific MCP tools. ### How did you verify your code works? Ran the TUI and tried MCP tool calls with various different datatypes. Ensured existing tool calls (e.g. read, write) were not impacted. Also verified all 3 new configuration states worked as expected. Before (or with mcp_show_parameters==="none"): <img width="653" height="1294" alt="image" src="https://github.com/user-attachments/assets/ff799028-a3a7-4205-99a9-1b1c758597d7" /> After: <img width="710" height="1304" alt="image" src="https://github.com/user-attachments/assets/c5368b59-c082-450a-910a-ede1fed52395" />
yindo added the pull-request label 2026-02-16 18:19:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14238