Skip to content

v0.4.0: Account intelligence: health records, health-aware failover, priorities and a failover policy

Choose a tag to compare

@onoja123 onoja123 released this 13 Oct 18:46
42916ac

Summary

csm already switched accounts on a usage limit, but it always took the next account in the list, knew nothing about why an account had failed before, and showed usage only when you asked. This PR gives every account a provider-neutral health record and makes failover choose the account most likely to keep working, deterministically, while keeping manual switching exactly as it was.

What changes for users

$ csm accounts
Accounts (Claude Code)
────────────────────────────────

  ● work         healthy                  5h 18% · 7d 40%    priority 1
  ○ personal     warning                  5h 84% · 7d 61%    priority 2
  ○ backup       rate_limited until 17:10 unknown            priority 3

Order:
work → personal → backup
  • Health per account: healthy, warning (a usage window at or above 80%), rate_limited (in cooldown, or the agent reported rejections within the last hour), authentication_required, unavailable (disabled), unknown (the last run ended with an error that was not a usage limit and nothing has worked since).
  • Usage is never estimated. It is shown only when the agent reported it and the window has not reset; otherwise unknown.
  • Health-aware failover. Candidates are ranked by health, then fewer failures in the last 24 hours, then your priority. csm auto status prints both your priority order and the order a switch would actually try.
  • csm next is unchanged: it follows your priority order exactly.
  • Priority is the existing account order, surfaced as priority N and changed with csm account priority <name> <n>, which reorders within one agent without disturbing the others.
  • Failover policy: csm auto automatic | manual | disabled | status. on/off remain aliases of automatic/manual. disabled reports the limit and stops; manual reports it and, in a terminal, offers the switch.
  • csm account health <name> shows one account in detail: health, status, priority, usage and when it was checked, last used, last success, last failure and its classification, failures in 24 hours, cooldown, profile path, and a one-line next step.

Pull request: #4
Full changelog: v0.3.0...v0.4.0