(id)
| 659 | * Remove an account by ID. |
| 660 | */ |
| 661 | export function removeAccount(id) { |
| 662 | const idx = accounts.findIndex(a => a.id === id); |
| 663 | if (idx === -1) return false; |
| 664 | const account = accounts[idx]; |
| 665 | accounts.splice(idx, 1); |
| 666 | saveAccounts(); |
| 667 | // Drop any Cascade conversations owned by this key so future requests |
| 668 | // don't try to resume on an account that no longer exists. |
| 669 | import('./conversation-pool.js').then(m => m.invalidateFor({ apiKey: account.apiKey })).catch(() => {}); |
| 670 | log.info(`Account removed: ${safeAccountRef(account)}`); |
| 671 | return true; |
| 672 | } |
| 673 | |
| 674 | // ─── Account selection (tier-weighted RPM) ───────────────── |
| 675 |
no test coverage detected