fix(coding-agent): fixed credential blocking logic to check remaining available credentials
- Fixed credential blocking logic to correctly check for remaining available credentials instead of always returning true.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user