Skip to content

fix(session): show specific MCP tool in permission patterns - #19618

Closed
AndresCdo wants to merge 3 commits into
anomalyco:devfrom
AndresCdo:fix/mcp-permission-pattern-name-19549
Closed

AndresCdo wants to merge 3 commits into
anomalyco:devfrom
AndresCdo:fix/mcp-permission-pattern-name-19549

Conversation

@AndresCdo

Copy link
Copy Markdown

Issue for this PR

Closes #19549

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes MCP permission prompts showing * instead of the real MCP tool name. In MCP tool execution wrapping, permission request patterns now use the concrete tool key ([key]) for both patterns and always instead of wildcard values.

How did you verify your code works?

  • Added a regression test in test/session/prompt.test.ts that resolves tools with a mocked MCP tool and asserts the permission request uses the MCP key in patterns and always.
  • Ran bun test test/session/prompt.test.ts -t "mcp permission patterns" from packages/opencode.
  • Ran bun typecheck from packages/opencode.

Screenshots / recordings

N/A (permission request metadata fix).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

PR #12801: feat(opencode): mcp permission patterns
#12801

This PR is related because it addresses MCP permission patterns, which is the same feature area that PR #19618 is fixing. PR #12801 appears to be the original feature implementation, while PR #19618 is fixing a bug where permission prompts show * instead of the actual MCP tool name.

Request MCP tool permission with the concrete tool key instead of wildcard patterns, and remove stale prompt test code that referenced an internal API no longer exported.
@AndresCdo
AndresCdo force-pushed the fix/mcp-permission-pattern-name-19549 branch from 2d4a693 to 9e44794 Compare March 31, 2026 00:39
@rekram1-node

Copy link
Copy Markdown
Collaborator

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP tools show * instead of actual tool name in permission dialogs

2 participants