pick which accounts auto-rotation uses first - #32
Open
pedroapfilho wants to merge 1 commit into
Open
pedroapfilho wants to merge 1 commit into
pedroapfilho wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets you choose which accounts auto-rotation uses first. Today it always switches to the account with the most room left, and there's no way to say "use my work account before my personal one".
Behavior
threshold − hysteresis. It no longer picks the emptiest account.automatic:preferred. The hysteresis gap means it only moves back once that account is well under the threshold, and the cooldown stops it switching back and forth.How you set it
[and]move the selected account in its provider's order. With an order set, account rows are listed in that order, and the panel title readsauto 90% · in order.tokenmaxx listshows each account's place in the order.Changes
domain.ts:Accountgets an optionalpriority(integer, lower goes first). Existing stored accounts read fine without it.selection.ts: candidates sort by order, then usage, then id, and there's a newpreferredrotation for moving back.orderRank()is shared with the CLI and the dashboard.manager.ts: newsetAccountOrder(provider, accountIds). It re-evaluates auto-rotation right away, so a move back can happen immediately.ipc.ts: new daemon methodaccount/order, withrequestAccountOrder.cli.ts: thetokenmaxx ordercommand,listshows order positions, and help text.tui/dashboard.ts: row ordering, the[/]keys, and thein ordermarker.Tests
bun run checkpasses with 98 tests:setAccountOrder: partial order, clearing, and rejecting an account from another provider.I didn't run this against a live daemon or real accounts. The rotation paths are covered by unit tests only.
Notes