Fix unhandled rejections from "upstream ref ... is not a GitHub repo"#8730
Draft
Fix unhandled rejections from "upstream ref ... is not a GitHub repo"#8730
Conversation
Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/0f354983-7de0-48fd-83e4-7af7fe874a8d Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix sporadic VSCode hangs during extension development
Fix unhandled rejections from "upstream ref ... is not a GitHub repo"
May 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.
When a workspace's branch upstream points at a non-GitHub remote (e.g., a parent folder with a non-GitHub
origin),getPullRequestDefaults()throwsBadUpstreamError. Two callers fail to handle this, producing repeated unhandled promise rejections in the Debug Console — matching the screenshot in the issue and likely correlating with the reported VS Code unresponsiveness, since the chat context provider re-fires on many events.Changes
src/lm/pullRequestContextProvider.ts—WorkspaceContextProvider.provideWorkspaceChatContextawaitedgetPullRequestDefaults()per folder with no try/catch. Wrap it, skip the offending folder, and debug-log its URI. This is the first stack in the screenshot:src/view/treeNodes/categoryNode.ts— The catch handler dide.response.status === 422, which throwsTypeErrorfor any error lacking.response(e.g.BadUpstreamErrorpropagated fromextractRepoFromQuery). Because the throw occurs inside the catch, it escapes as a second unhandled rejection (thegetPullRequestsForQuerystack in the screenshot). Optional-chained the access: