agentHost: add url permission request handling and refine confirmation titles#312021
Merged
connor4312 merged 2 commits intomainfrom Apr 22, 2026
Merged
agentHost: add url permission request handling and refine confirmation titles#312021connor4312 merged 2 commits intomainfrom
connor4312 merged 2 commits intomainfrom
Conversation
…n titles - Add handling for 'url' kind permission requests in getPermissionDisplay, with URL sanitization via the URL constructor for punycode escaping - Add 'url' property to ITypedPermissionRequest interface - Improve confirmation titles to use question format for consistency (e.g. 'Run in terminal?' instead of 'Run in terminal') - Improve custom-tool and default permission display to use markdown invocation messages with the tool name for richer rendering - Refine MCP permission confirmation title to use localized format Fixes #311504 (Commit message generated by Copilot)
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the agent host’s Copilot permission-request UI mapping so new permission kinds (notably URL fetch) render with more consistent confirmation titles and richer (markdown-capable) invocation messages.
Changes:
- Add
url?: stringtoITypedPermissionRequestand handlekind: 'url'ingetPermissionDisplay(with URL normalization viaURL). - Refine confirmation titles to be question-style (e.g., “Run in terminal?” / “Read file?” / “Write file?”).
- Switch default/custom-tool permission invocation messages to markdown rendering and localize MCP confirmation titles.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts | Extends typed permission request shape and updates permission display mapping (titles, markdown invocation messages, and URL/MCP handling). |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts:531
- The default permission
invocationMessageis now markdown and interpolatesrequest.toolNamedirectly. Since tool names are not guaranteed to be safe markdown, this can render incorrectly or allow link/formatting injection. Prefer usingstr(request.toolName)(or the precomputedtoolName) plus a safe fallback, and escape/inline-code the value before inserting into the markdown string.
confirmationTitle: localize('copilot.permission.default.title', "Allow tool call?"),
invocationMessage: md(localize('copilot.permission.default.message', "Allow the model to call {0}?", request.toolName || request.kind)),
toolInput: tryStringify(request) ?? undefined,
- Files reviewed: 1/1 changed files
- Comments generated: 3
roblourens
approved these changes
Apr 22, 2026
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.
agentHost: add url permission request handling and refine confirmation titles
with URL sanitization via the URL constructor for punycode escaping
(e.g. 'Run in terminal?' instead of 'Run in terminal')
invocation messages with the tool name for richer rendering
Fixes #311504
(Commit message generated by Copilot)