From c3b4b10432326ec244aff500b42fdfb48e703a60 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 May 2026 14:49:22 +0000 Subject: [PATCH 1/2] Initial plan From c6851bbba4c95c46d5259070f9b191e47fb2f9d1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 May 2026 15:04:55 +0000 Subject: [PATCH 2/2] Suppress duplicate "Bad credentials" popup; rely on centralized re-auth Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/view/treeNodes/categoryNode.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/view/treeNodes/categoryNode.ts b/src/view/treeNodes/categoryNode.ts index b3551d2b3f..eaa76d343f 100644 --- a/src/view/treeNodes/categoryNode.ts +++ b/src/view/treeNodes/categoryNode.ts @@ -13,6 +13,7 @@ import { formatError } from '../../common/utils'; import { isCopilotQuery } from '../../github/copilotPrWatcher'; import { FolderRepositoryManager, ItemsResponseResult } from '../../github/folderRepositoryManager'; import { PRType } from '../../github/interface'; +import { isAuthError } from '../../github/loggingOctokit'; import { PullRequestModel } from '../../github/pullRequestModel'; import { extractRepoFromQuery } from '../../github/utils'; import { PrsTreeModel } from '../prsTreeModel'; @@ -299,6 +300,17 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem { } catch (e) { if (this.isCopilot && (e?.response?.status === 422) && e.message?.includes('the users do not exist')) { // Skip it, it's copilot and the repo doesn't have copilot + } else if (isAuthError(e)) { + // Auth errors (revoked/expired token) are handled centrally by + // CredentialStore.handleAuthError (wired up through RateLogger), + // which prompts the user to re-authenticate. Showing an additional + // "Fetching pull requests failed: Bad credentials" notification + // here is redundant and on some platforms (e.g. macOS) the + // notification can linger on screen after the user has already + // completed the re-authentication flow, making it look like the + // sign-in failed even when it succeeded. Just mark the tree as + // needing login so the "Sign in" entry is shown. + needLogin = true; } else { const error = formatError(e); const actions: string[] = [];