Skip to content

Commit 83d934a

Browse files
committed
fix expired cache load regression test
1 parent dc2347e commit 83d934a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/accounts-load-from-disk.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe("AccountManager loadFromDisk", () => {
125125
expect(saveAccounts).toHaveBeenCalledTimes(1);
126126
});
127127

128-
it("skips expired Codex CLI cache entries and does not persist", async () => {
128+
it("skips expired access hydration but backfills missing account identity", async () => {
129129
const now = Date.now();
130130
vi.mocked(loadAccounts).mockResolvedValue({
131131
version: 3 as const,
@@ -155,8 +155,9 @@ describe("AccountManager loadFromDisk", () => {
155155
const account = manager.getCurrentAccount();
156156

157157
expect(account?.access).toBeUndefined();
158-
expect(account?.accountId).toBeUndefined();
159-
expect(saveAccounts).not.toHaveBeenCalled();
158+
expect(account?.accountId).toBe("acct-expired");
159+
expect(account?.accountIdSource).toBe("token");
160+
expect(saveAccounts).toHaveBeenCalledTimes(1);
160161
});
161162

162163
it("syncCodexCliActiveSelectionForIndex ignores invalid indices and syncs a valid one", async () => {

0 commit comments

Comments
 (0)