Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

chore(desktop): merge main and retain quota credential binding

qianbodc534c952542
diff --cc apps/desktop/src/main/model-access/index.ts
index 76cd1bae69,796b8dded1..a2029ae177
--- a/apps/desktop/src/main/model-access/index.ts
+++ b/apps/desktop/src/main/model-access/index.ts
@@@ -516,12 -499,9 +505,15 @@@ function mapServerError(err: unknown):
*/
export function initModelAccess(): void {
const sync = getSync();
+ setQuotaCredentialStatusReader(() => {
+ const auth = authManager.getAuthState();
+ if (auth.mode !== 'cloud' || !auth.user?.id || auth.user.id !== lastAuthUserId
+ || authManager.getActiveAuthRealm() !== lastAuthRealm) return null;
+ return sync.getStatus();
+ });
+ // 主进程各调用方遇到 Cindy 网关 401 时经此重新拉取凭据(服务端会探测并换发失效 Key)。
+ // 用静默同步:失败不降级状态、不清空模型列表(见 credentialsSync.resyncAfterKeyRejection)。
+ installCindyGatewayKeyRejectionReporter(() => getSync().resyncAfterKeyRejection());
const byok = createByokRuntime(
broadcastReferenceModelPricing,
createByokCache(byokSnapshotSecretIo),