From e2a339027f7b059a4ae2e2ec2298d53059c138d0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 06:48:30 +0100 Subject: [PATCH] refactor: keep auth profile helpers internal --- src/agents/auth-profiles/oauth-refresh-failure.ts | 6 ++---- src/agents/auth-profiles/usage-state.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/agents/auth-profiles/oauth-refresh-failure.ts b/src/agents/auth-profiles/oauth-refresh-failure.ts index 4cea4112fcd..71a9fb78ab0 100644 --- a/src/agents/auth-profiles/oauth-refresh-failure.ts +++ b/src/agents/auth-profiles/oauth-refresh-failure.ts @@ -12,14 +12,12 @@ export type OAuthRefreshFailureReason = const OAUTH_REFRESH_FAILURE_PROVIDER_RE = /OAuth token refresh failed for ([^:]+):/i; const SAFE_PROVIDER_ID_RE = /^[a-z0-9][a-z0-9._-]*$/; -export function extractOAuthRefreshFailureProvider(message: string): string | null { +function extractOAuthRefreshFailureProvider(message: string): string | null { const provider = message.match(OAUTH_REFRESH_FAILURE_PROVIDER_RE)?.[1]?.trim(); return provider && provider.length > 0 ? provider : null; } -export function sanitizeOAuthRefreshFailureProvider( - provider: string | null | undefined, -): string | null { +function sanitizeOAuthRefreshFailureProvider(provider: string | null | undefined): string | null { const sanitized = provider ? sanitizeForLog(provider).replaceAll("`", "").trim() : ""; const normalized = normalizeProviderId(sanitized); return normalized && SAFE_PROVIDER_ID_RE.test(normalized) ? normalized : null; diff --git a/src/agents/auth-profiles/usage-state.ts b/src/agents/auth-profiles/usage-state.ts index 90774f52b52..9f2f6f86682 100644 --- a/src/agents/auth-profiles/usage-state.ts +++ b/src/agents/auth-profiles/usage-state.ts @@ -22,7 +22,7 @@ export function isActiveUnusableWindow(until: number | undefined, now: number): return typeof until === "number" && Number.isFinite(until) && until > 0 && now < until; } -export function shouldBypassModelScopedCooldown( +function shouldBypassModelScopedCooldown( stats: Pick, now: number, forModel?: string,