From 04271651d4fc0eb40f654b2bcb9ac919fbd7b8ab Mon Sep 17 00:00:00 2001 From: adhitShet Date: Thu, 19 Feb 2026 22:56:13 +0000 Subject: [PATCH] fix: update misleading comment in orderProfilesByMode to reflect both sort criteria Comment now accurately describes that sorting is by type preference (oauth > token > api_key) then by lastUsed oldest-first for round-robin within type. Co-Authored-By: Claude Opus 4.6 --- src/agents/auth-profiles/order.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/auth-profiles/order.ts b/src/agents/auth-profiles/order.ts index 947e955860a..405ca081bbb 100644 --- a/src/agents/auth-profiles/order.ts +++ b/src/agents/auth-profiles/order.ts @@ -144,7 +144,7 @@ function orderProfilesByMode(order: string[], store: AuthProfileStore): string[] } } - // Sort available profiles by lastUsed (oldest first = round-robin) + // Sort available profiles by type preference, then by lastUsed (oldest first = round-robin within type) const scored = available.map((profileId) => { const type = store.profiles[profileId]?.type; const typeScore = type === "oauth" ? 0 : type === "token" ? 1 : type === "api_key" ? 2 : 3;