Repository navigation
fix(auth): prioritize round-robin over lastGood for multi-account rotation - #281
Merged
Merged
Conversation
…ation When multiple OAuth accounts are configured, the round-robin rotation was not working because lastGood was always prioritized, defeating the sort by lastUsed. Changes: - Remove lastGood prioritization in resolveAuthProfileOrder - Always apply orderProfilesByMode (sorts by lastUsed, oldest first) - Only respect configuredOrder when explicitly set in config - preferredProfile still takes priority for explicit user choice Tested with 2 Google Antigravity accounts - verified alternating usage. Follow-up to PR openclaw#269.
Contributor
|
Thanks @mukhtharcm — merged. I’m following up to (1) update the auth profile ordering tests to match the new round-robin behavior and (2) adjust so it doesn’t write by default (round-robin unless explicitly pinned). |
Contributor
|
Thanks @mukhtharcm — merged. Follow-up on main:
|
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 9, 2026
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 22, 2026
…anagementBoard (write+wire)
heatherstew44-maker
pushed a commit
to heatherstew44-maker/openclaw
that referenced
this pull request
Mar 8, 2026
heatherstew44-maker
pushed a commit
to heatherstew44-maker/openclaw
that referenced
this pull request
Mar 8, 2026
) This reverts commit 8768eba.
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
…ation (openclaw#281) * fix(auth): prioritize round-robin over lastGood for multi-account rotation When multiple OAuth accounts are configured, the round-robin rotation was not working because lastGood was always prioritized, defeating the sort by lastUsed. Changes: - Remove lastGood prioritization in resolveAuthProfileOrder - Always apply orderProfilesByMode (sorts by lastUsed, oldest first) - Only respect configuredOrder when explicitly set in config - preferredProfile still takes priority for explicit user choice Tested with 2 Google Antigravity accounts - verified alternating usage. Follow-up to PR openclaw#269. * style: fix formatting
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
…ation (openclaw#281) * fix(auth): prioritize round-robin over lastGood for multi-account rotation When multiple OAuth accounts are configured, the round-robin rotation was not working because lastGood was always prioritized, defeating the sort by lastUsed. Changes: - Remove lastGood prioritization in resolveAuthProfileOrder - Always apply orderProfilesByMode (sorts by lastUsed, oldest first) - Only respect configuredOrder when explicitly set in config - preferredProfile still takes priority for explicit user choice Tested with 2 Google Antigravity accounts - verified alternating usage. Follow-up to PR openclaw#269. * style: fix formatting
muneebhashone
pushed a commit
to muneebhashone/clawdbot
that referenced
this pull request
Aug 25, 2026
…ation (openclaw#281) * fix(auth): prioritize round-robin over lastGood for multi-account rotation When multiple OAuth accounts are configured, the round-robin rotation was not working because lastGood was always prioritized, defeating the sort by lastUsed. Changes: - Remove lastGood prioritization in resolveAuthProfileOrder - Always apply orderProfilesByMode (sorts by lastUsed, oldest first) - Only respect configuredOrder when explicitly set in config - preferredProfile still takes priority for explicit user choice Tested with 2 Google Antigravity accounts - verified alternating usage. Follow-up to PR openclaw#269. * style: fix formatting
zeekay
pushed a commit
to Dream-AI-4444/bot
that referenced
this pull request
Sep 11, 2026
…ation (openclaw#281) * fix(auth): prioritize round-robin over lastGood for multi-account rotation When multiple OAuth accounts are configured, the round-robin rotation was not working because lastGood was always prioritized, defeating the sort by lastUsed. Changes: - Remove lastGood prioritization in resolveAuthProfileOrder - Always apply orderProfilesByMode (sorts by lastUsed, oldest first) - Only respect configuredOrder when explicitly set in config - preferredProfile still takes priority for explicit user choice Tested with 2 Google Antigravity accounts - verified alternating usage. Follow-up to PR openclaw#269. * style: fix formatting
lhfer
pushed a commit
to lhfer/openclaw
that referenced
this pull request
Oct 11, 2026
…ation (openclaw#281) * fix(auth): prioritize round-robin over lastGood for multi-account rotation When multiple OAuth accounts are configured, the round-robin rotation was not working because lastGood was always prioritized, defeating the sort by lastUsed. Changes: - Remove lastGood prioritization in resolveAuthProfileOrder - Always apply orderProfilesByMode (sorts by lastUsed, oldest first) - Only respect configuredOrder when explicitly set in config - preferredProfile still takes priority for explicit user choice Tested with 2 Google Antigravity accounts - verified alternating usage. Follow-up to PR openclaw#269. * style: fix formatting
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.
Summary
Fixes multi-account OAuth rotation so accounts actually alternate instead of always using the same one.
Problem
When multiple OAuth accounts are configured for a provider (e.g., 2 Google Antigravity accounts), the round-robin rotation was not working. All requests used the same account.
Root Cause
In
resolveAuthProfileOrder(), the code checkedlastGoodafter sorting and always put it first:Once any profile succeeded (became
lastGood), it would always be selected first, defeating the round-robin logic entirely.Solution
lastGoodprioritization - let round-robin handle selectionconfiguredOrderwhen user specifies it in configorderProfilesByMode()now always runs, sorting bylastUsed(oldest first)preferredProfilestill takes priority (for explicit user choice)Note on clawdbot configure
Currently
clawdbot configureautomatically creates anauth.orderkey when adding multiple accounts. This explicit order takes precedence over round-robin (by design - explicit config = user intent).Users who want round-robin should remove the
orderkey from theirclawdbot.json:A follow-up issue could update the configure wizard to not create order by default.
Testing
Tested with 2 Google Antigravity accounts. Verified alternating usage - each request picks the account with oldest lastUsed timestamp.
Related
Follow-up fix to PR #269 (multi-account OAuth support).