From f2d353459f783bb9dadfaa060ccc269938c22a97 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 6 Jan 2026 09:25:33 +0100 Subject: [PATCH] test(auth): stop prioritizing lastGood --- src/agents/auth-profiles.test.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/agents/auth-profiles.test.ts b/src/agents/auth-profiles.test.ts index ea5d5fdcb..3b19dd8d5 100644 --- a/src/agents/auth-profiles.test.ts +++ b/src/agents/auth-profiles.test.ts @@ -50,13 +50,20 @@ describe("resolveAuthProfileOrder", () => { expect(order).toContain("anthropic:default"); }); - it("prioritizes last-good profile when no preferred override", () => { + it("does not prioritize lastGood over round-robin ordering", () => { const order = resolveAuthProfileOrder({ cfg, - store: { ...store, lastGood: { anthropic: "anthropic:work" } }, + store: { + ...store, + lastGood: { anthropic: "anthropic:work" }, + usageStats: { + "anthropic:default": { lastUsed: 100 }, + "anthropic:work": { lastUsed: 200 }, + }, + }, provider: "anthropic", }); - expect(order[0]).toBe("anthropic:work"); + expect(order[0]).toBe("anthropic:default"); }); it("uses explicit profiles when order is missing", () => {