Skip to content

fix: keep rate-limited sessions on the failover account#5

Open
Emilvooo wants to merge 1 commit intodkraemerwork:mainfrom
Emilvooo:fix/session-binding-rate-limit-failover
Open

fix: keep rate-limited sessions on the failover account#5
Emilvooo wants to merge 1 commit intodkraemerwork:mainfrom
Emilvooo:fix/session-binding-rate-limit-failover

Conversation

@Emilvooo
Copy link
Copy Markdown

Summary

  • fix sessions repeatedly retrying a known rate-limited account and showing the same account-switch toast on every prompt
  • rebind the session to the failover account after rate limits or auth failures so later prompts stay on the working account
  • skip stale session bindings that point to unavailable accounts and persist rate-limit state so restarts do not forget limited accounts

Why

  • the plugin could switch from account 1 to account 2 after a rate-limit response, but the stored session binding still pointed at account 1
  • that caused the next prompt in the same session to start on the limited account again, which retriggered the same failover loop
  • rate-limit state was also only kept in memory, so restarts could bring the same limited account back into rotation too early

Testing

  • npm run typecheck
  • npm test
  • npm run build

@Emilvooo Emilvooo requested a review from dkraemerwork as a code owner March 15, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant