diff --git a/docs/porting-from-pi-mono.md b/docs/porting-from-pi-mono.md index 6a6381b45..241fa3b4d 100644 --- a/docs/porting-from-pi-mono.md +++ b/docs/porting-from-pi-mono.md @@ -5,12 +5,12 @@ Use it for any merge: single file, feature branch, or full release sync. ## Last Sync Point -**Commit:** `11dd2f47` +**Commit:** `f1b64b9d` **Date:** January 2026 When starting a new sync, generate patches from this commit forward: ```bash -git format-patch 11dd2f47..HEAD --stdout > changes.patch +git format-patch f1b64b9d..HEAD --stdout > changes.patch ``` ## 0) Define the scope diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index fb45b06b0..d60d3d3f5 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## [Unreleased] +### Fixed + +- Fixed credential blocking logic to correctly check for remaining available credentials instead of always returning true ## [4.0.1] - 2026-01-10 ### Added diff --git a/packages/coding-agent/src/core/auth-storage.ts b/packages/coding-agent/src/core/auth-storage.ts index 4814912cc..b7fcdbf9b 100644 --- a/packages/coding-agent/src/core/auth-storage.ts +++ b/packages/coding-agent/src/core/auth-storage.ts @@ -797,7 +797,15 @@ export class AuthStorage { } this.markCredentialBlocked(providerKey, sessionCredential.index, blockedUntil); - return true; + + const remainingCredentials = this.getCredentialsForProvider(provider) + .map((credential, index) => ({ credential, index })) + .filter( + (entry): entry is { credential: AuthCredential; index: number } => + entry.credential.type === sessionCredential.type && entry.index !== sessionCredential.index, + ); + + return remainingCredentials.some((candidate) => !this.isCredentialBlocked(providerKey, candidate.index)); } /**