Skip to content

Fix unhandled rejections from "upstream ref ... is not a GitHub repo"#8730

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-vscode-hanging-issue
Draft

Fix unhandled rejections from "upstream ref ... is not a GitHub repo"#8730
Copilot wants to merge 2 commits intomainfrom
copilot/fix-vscode-hanging-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

When a workspace's branch upstream points at a non-GitHub remote (e.g., a parent folder with a non-GitHub origin), getPullRequestDefaults() throws BadUpstreamError. 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.tsWorkspaceContextProvider.provideWorkspaceChatContext awaited getPullRequestDefaults() 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:

    at getOrigin → getPullRequestDefaults → provideWorkspaceChatContext
    
  • src/view/treeNodes/categoryNode.ts — The catch handler did e.response.status === 422, which throws TypeError for any error lacking .response (e.g. BadUpstreamError propagated from extractRepoFromQuery). Because the throw occurs inside the catch, it escapes as a second unhandled rejection (the getPullRequestsForQuery stack in the screenshot). Optional-chained the access:

    if (this.isCopilot && (e?.response?.status === 422) && e.message?.includes('the users do not exist')) {

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
Copilot finished work on behalf of alexr00 May 7, 2026 12:11
Copilot AI requested a review from alexr00 May 7, 2026 12:11
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.

vscode hangs: "the upstream ref origin/master for branch master is not a github repo"

2 participants