Skip to content

agentHost: add url permission request handling and refine confirmation titles#312021

Merged
connor4312 merged 2 commits intomainfrom
connor4312/311504
Apr 22, 2026
Merged

agentHost: add url permission request handling and refine confirmation titles#312021
connor4312 merged 2 commits intomainfrom
connor4312/311504

Conversation

@connor4312
Copy link
Copy Markdown
Member

agentHost: add url permission request handling and refine confirmation 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)

…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)
Copilot AI review requested due to automatic review settings April 22, 2026 22:18
@connor4312 connor4312 enabled auto-merge (squash) April 22, 2026 22:18
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 1f9cd94d Current: 3790e86f

Changed (1)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?: string to ITypedPermissionRequest and handle kind: 'url' in getPermissionDisplay (with URL normalization via URL).
  • 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 invocationMessage is now markdown and interpolates request.toolName directly. Since tool names are not guaranteed to be safe markdown, this can render incorrectly or allow link/formatting injection. Prefer using str(request.toolName) (or the precomputed toolName) 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

Comment thread src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts Outdated
Comment thread src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts Outdated
Comment thread src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts
@connor4312 connor4312 merged commit e64dce3 into main Apr 22, 2026
26 checks passed
@connor4312 connor4312 deleted the connor4312/311504 branch April 22, 2026 22:40
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 22, 2026
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.

AHP: "Permission request" appears twice in chat ui

3 participants