fix: avoid Claude token refresh races across services

This commit is contained in:
Eyejoker
2026-03-26 10:25:09 +09:00
parent 2b74e6fe40
commit f79baf1ff8
3 changed files with 31 additions and 2 deletions

13
src/token-refresh.test.ts Normal file
View File

@@ -0,0 +1,13 @@
import { describe, expect, it } from 'vitest';
import { shouldStartTokenRefreshLoop } from './token-refresh.js';
describe('shouldStartTokenRefreshLoop', () => {
it('starts refresh for the Claude service', () => {
expect(shouldStartTokenRefreshLoop('claude-code')).toBe(true);
});
it('skips refresh for the Codex service', () => {
expect(shouldStartTokenRefreshLoop('codex')).toBe(false);
});
});