From e95a25512d5f471b410ad596997ecbb3063d768e Mon Sep 17 00:00:00 2001 From: Webman Date: Wed, 26 Aug 2026 15:40:14 -0500 Subject: [PATCH] fix(resilience): restore expired-connection retry-budget probe in health sweep (#11672) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merged via /merge-batch (2026-08-26, v3.8.51). Boarded no worktree combinado; validação única: typecheck/complexity/cognitive-complexity/file-size/changelog verdes, lint nos mesmos 228 achados pré-existentes confirmados contra o tip puro, testes focados passando. Obrigado pela contribuição. --- .../fixes/11592-token-health-retry-budget-boundary.md | 1 + src/lib/tokenHealthCheck.ts | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) create mode 100644 changelog.d/fixes/11592-token-health-retry-budget-boundary.md diff --git a/changelog.d/fixes/11592-token-health-retry-budget-boundary.md b/changelog.d/fixes/11592-token-health-retry-budget-boundary.md new file mode 100644 index 0000000000..44e2c05337 --- /dev/null +++ b/changelog.d/fixes/11592-token-health-retry-budget-boundary.md @@ -0,0 +1 @@ +- **resilience:** restore the expired-connection retry-budget probe in the token-health sweep — the `!isGitHubAccessTokenOnlyConnection` carve-out reintroduced by #11608 contradicted the boundary pinned by #11592, so a GitHub connection parked at `expired` with retry budget remaining was never probed and could never self-heal ([#11592](https://github.com/diegosouzapw/OmniRoute/pull/11592)). diff --git a/src/lib/tokenHealthCheck.ts b/src/lib/tokenHealthCheck.ts index 432b57d088..b3a4e2e074 100644 --- a/src/lib/tokenHealthCheck.ts +++ b/src/lib/tokenHealthCheck.ts @@ -599,13 +599,6 @@ export async function checkConnection(conn) { const isRecoverableExpiredWithRetryBudget = conn.testStatus === "expired" && conn.lastErrorType !== "account_deactivated" && - // GitHub access-token-only connections have their own dedicated exemption - // (isRecoverableGithubCopilotNoRefresh above): ONLY the exact - // "no_refresh_token" shape self-heals. An "expired" GitHub connection for a - // different reason (e.g. invalid_grant) is genuinely terminal and must stay - // skipped, otherwise the generic retry-budget exemption below reopens #8182's - // wasted-probe fix for every "expired" GitHub connection. - !isGitHubAccessTokenOnlyConnection(conn) && getExpiredRetryCount(conn) < EXPIRED_RETRY_MAX; const terminalStatuses = new Set(["credits_exhausted", "banned", "expired"]); if (