@kervnet/opencode-kiro-auth 1.7.7 → 1.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,6 +52,22 @@ export class RequestHandler {
|
|
|
52
52
|
throw new Error(check.error);
|
|
53
53
|
}
|
|
54
54
|
if (this.allAccountsPermanentlyUnhealthy()) {
|
|
55
|
+
// Try to recover by syncing from kiro-cli
|
|
56
|
+
if (this.config.auto_sync_kiro_cli) {
|
|
57
|
+
showToast('All accounts unhealthy. Attempting recovery from Kiro CLI...', 'warning');
|
|
58
|
+
const { syncFromKiroCli } = await import('../../plugin/sync/kiro-cli.js');
|
|
59
|
+
await syncFromKiroCli();
|
|
60
|
+
// Reset all accounts to healthy and clear fail counts
|
|
61
|
+
const accounts = this.accountManager.getAccounts();
|
|
62
|
+
for (const acc of accounts) {
|
|
63
|
+
acc.isHealthy = true;
|
|
64
|
+
acc.failCount = 0;
|
|
65
|
+
acc.unhealthyReason = undefined;
|
|
66
|
+
}
|
|
67
|
+
await this.repository.batchSave(accounts);
|
|
68
|
+
// Give it one more chance
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
55
71
|
throw new Error('All accounts are permanently unhealthy (quota exceeded or suspended)');
|
|
56
72
|
}
|
|
57
73
|
let acc = await this.accountSelector.selectHealthyAccount(showToast);
|
package/package.json
CHANGED