Open PR links from chat without a workspace - #8933
Merged
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with opening PR link from chat in Agents window
Open PR links from chat without a workspace
Sep 7, 2026
Alex Ross (alexr00)
marked this pull request as ready for review
September 7, 2026 15:13
Alex Ross (alexr00)
approved these changes
Sep 7, 2026
Alex Ross (alexr00)
enabled auto-merge (squash)
September 7, 2026 15:14
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes consistently centralize manager resolution for no-workspace scenarios and include targeted tests validating the new behavior.
Pull request overview
This PR fixes opening GitHub issue/PR links (including from chat) when no workspace is open by centralizing “folder repository manager” resolution. Instead of assuming a workspace-backed RepositoriesManager.folderManagers[0] exists, it lazily creates (and reuses) a remote-only FolderRepositoryManager so webviews can be opened reliably in “no workspace” scenarios.
Changes:
- Introduces
FolderRepositoryManagerResolverto return an existing workspace manager when available, or lazily create/reuse a remote-only manager otherwise. - Routes both
UriHandler(vscode:// extension URIs) andExternalUriOpener(https:// links) through the shared resolver to avoid undefined managers and duplicate remote-only instances. - Adds/updates tests to cover the “no workspace open” behavior for both URI handling and external URI opening.
File summaries
| File | Description |
|---|---|
| src/uriHandler.ts | Uses the shared resolver to obtain a valid manager when opening issue/PR overview webviews via extension URIs. |
| src/github/externalUriOpener.ts | Replaces ad-hoc remote-only manager creation with the shared resolver for opening GitHub links externally. |
| src/github/overviewRestorer.ts | Wires the external URI opener registration through the new resolver. |
| src/github/folderRepositoryManagerResolver.ts | New shared resolver that returns an existing manager or creates/reuses a remote-only FolderRepositoryManager. |
| src/extension.ts | Instantiates and disposes the resolver via context.subscriptions, then injects it into OverviewRestorer and UriHandler. |
| src/test/uriHandler.test.ts | New test validating PR link opening uses a remote-only manager when no workspace is open. |
| src/test/github/externalUriOpener.test.ts | Updates test wiring to use/dispose the resolver and validates remote-only behavior remains correct. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Giuseppe Cianci (Giuspepe)
approved these changes
Sep 7, 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.
Opening a PR link from chat could show an empty overview and throw when the Agents window had no repository manager.