From 2efd265697966ee78e02ffc1d042987fc20c935e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 23 Jan 2026 07:10:18 +0000 Subject: [PATCH] Revert "fix: treat copilot oauth tokens as non-expiring" This reverts commit 35228ecae909a428f06cddaa456e022a49e0c015. --- src/agents/auth-profiles/oauth.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/agents/auth-profiles/oauth.ts b/src/agents/auth-profiles/oauth.ts index 788668382..d84f0aedf 100644 --- a/src/agents/auth-profiles/oauth.ts +++ b/src/agents/auth-profiles/oauth.ts @@ -39,15 +39,6 @@ async function refreshOAuthTokenWithLock(params: { const cred = store.profiles[params.profileId]; if (!cred || cred.type !== "oauth") return null; - if ( - cred.provider === "github-copilot" && - (!Number.isFinite(cred.expires) || cred.expires <= 0) - ) { - return { - apiKey: buildOAuthApiKey(cred.provider, cred), - newCredentials: cred, - }; - } if (Date.now() < cred.expires) { return { apiKey: buildOAuthApiKey(cred.provider, cred), @@ -112,13 +103,6 @@ async function tryResolveOAuthProfile(params: { if (profileConfig && profileConfig.provider !== cred.provider) return null; if (profileConfig && profileConfig.mode !== cred.type) return null; - if (cred.provider === "github-copilot" && (!Number.isFinite(cred.expires) || cred.expires <= 0)) { - return { - apiKey: buildOAuthApiKey(cred.provider, cred), - provider: cred.provider, - email: cred.email, - }; - } if (cred.provider === "github-copilot" && (!Number.isFinite(cred.expires) || cred.expires <= 0)) { return { apiKey: buildOAuthApiKey(cred.provider, cred),