Skip to content

Open canonical GitHub pull request URLs in the Pull Requests extension #8913

Description

Problem

The create-pull-request skill currently instructs AI agents to rewrite canonical GitHub pull request links such as:

https://github.com/microsoft/vscode/pull/330860

into extension-specific deep links:

vscode-insiders://github.vscode-pull-request-github/open-pull-request-webview?uri=https://github.com/microsoft/vscode/pull/330860

This leaks client and extension implementation details into agent output. It also means:

  • AI must know which editor and extension will handle the link.
  • Generated content is tied to either vscode:// or vscode-insiders://.
  • Copying the link produces a VS Code-specific URI instead of the canonical GitHub URL.
  • Other clients cannot interpret the link.
  • Users cannot choose whether PR links open in VS Code or their browser.

Agents should only need to emit canonical, portable GitHub URLs.

Proposal

Have the GitHub Pull Requests extension register an external URI opener for supported GitHub pull request URLs using VS Code's proposed ExternalUriOpener API:

  • Recognize canonical PR URLs such as https://github.com/{owner}/{repository}/pull/{number}.
  • Recognize equivalent URLs for configured GitHub Enterprise hosts.
  • Open matching URLs in the Pull Request webview.
  • Leave the browser available as an opener.
  • Integrate with VS Code's existing opener selection and workbench.externalUriOpeners configuration so users can choose their preferred behavior.

The create-pull-request skill could then return a normal Markdown link:

Created PR [#330860](https://github.com/microsoft/vscode/pull/330860) targeting `main`.

VS Code would resolve the preferred opener when the user clicks it.

Desired behavior

When a user clicks a canonical GitHub PR URL:

  1. If the user has configured a preferred opener, use it.
  2. Otherwise, offer applicable choices such as:
    • Open Pull Request in VS Code
    • Open in Default Browser
  3. Allow the user to configure a default for future PR links.

This should work for links from chat as well as links from editors, hovers, notifications, and other VS Code surfaces that permit contributed external URI openers.

Acceptance criteria

  • The Pull Requests extension registers an opener for canonical GitHub PR URLs.
  • Supported URLs open in the existing Pull Request webview.
  • GitHub Enterprise PR URLs are supported.
  • Users can retain the browser as their preferred handler.
  • AI-generated PR links no longer need a vscode:// or vscode-insiders:// wrapper.
  • The create-pull-request skill emits canonical HTTPS URLs.
  • Copied links remain portable and open correctly outside VS Code.

Related

The external URI opener API is currently proposed. If this extension cannot adopt a proposed API, finalizing that API may need to be tracked separately in microsoft/vscode.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions