retry token exchange on HTTP errors (not just network errors)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Colin McDonnell
2026-02-13 17:44:50 +00:00
committed by pullfrog[bot]
parent ac561bd4c8
commit 5e76fd86df
3 changed files with 18 additions and 3 deletions
+4 -1
View File
@@ -139610,7 +139610,10 @@ async function acquireTokenViaGitHubApp(opts) {
}
async function acquireNewToken(opts) {
if (isOIDCAvailable()) {
return await retry(() => acquireTokenViaOIDC(opts), { label: "token exchange" });
return await retry(() => acquireTokenViaOIDC(opts), {
label: "token exchange",
shouldRetry: (error49) => error49 instanceof Error && (error49.name === "AbortError" || error49.message.includes("fetch failed") || error49.message.includes("ECONNRESET") || error49.message.includes("ETIMEDOUT") || error49.message.includes("Token exchange failed"))
});
} else {
return await acquireTokenViaGitHubApp(opts);
}