style: format agent rotation updates

This commit is contained in:
Eyejoker
2026-03-24 17:09:17 +09:00
parent 8b2c46b89e
commit 744e2ce6e2
5 changed files with 9 additions and 12 deletions

View File

@@ -20,10 +20,7 @@ import {
} from './platform-prompts.js'; } from './platform-prompts.js';
import type { AgentType, RegisteredGroup } from './types.js'; import type { AgentType, RegisteredGroup } from './types.js';
function writeCodexApiKeyAuth( function writeCodexApiKeyAuth(authPath: string, openaiKey: string): void {
authPath: string,
openaiKey: string,
): void {
fs.writeFileSync( fs.writeFileSync(
authPath, authPath,
JSON.stringify( JSON.stringify(

View File

@@ -621,7 +621,9 @@ export class GroupQueue {
if (graceWaitMs > 0) { if (graceWaitMs > 0) {
await Promise.race([ await Promise.race([
Promise.all( Promise.all(
activeProcesses.map(({ process }) => this.waitForProcessExit(process)), activeProcesses.map(({ process }) =>
this.waitForProcessExit(process),
),
), ),
new Promise((resolve) => setTimeout(resolve, graceWaitMs)), new Promise((resolve) => setTimeout(resolve, graceWaitMs)),
]); ]);

View File

@@ -74,9 +74,7 @@ function isClaudeUsageExhaustedMessage(text: string): boolean {
function isClaudeAuthExpiredMessage(text: string): boolean { function isClaudeAuthExpiredMessage(text: string): boolean {
const normalized = text.trim().toLowerCase().replace(/\s+/g, ' '); const normalized = text.trim().toLowerCase().replace(/\s+/g, ' ');
const looksLikeAuthFailure = normalized.startsWith( const looksLikeAuthFailure = normalized.startsWith('failed to authenticate');
'failed to authenticate',
);
const hasExpiredTokenMarker = const hasExpiredTokenMarker =
normalized.includes('oauth token has expired') || normalized.includes('oauth token has expired') ||
normalized.includes('authentication_error') || normalized.includes('authentication_error') ||

View File

@@ -104,7 +104,9 @@ describe('provider fallback usage recovery', () => {
it('treats terminated 401 auth failures as an auth-expired fallback trigger', () => { it('treats terminated 401 auth failures as an auth-expired fallback trigger', () => {
expect( expect(
detectFallbackTrigger('Failed to authenticate. API Error: 401 terminated'), detectFallbackTrigger(
'Failed to authenticate. API Error: 401 terminated',
),
).toEqual({ ).toEqual({
shouldFallback: true, shouldFallback: true,
reason: 'auth-expired', reason: 'auth-expired',

View File

@@ -94,9 +94,7 @@ function isClaudeUsageExhaustedMessage(text: string): boolean {
function isClaudeAuthExpiredMessage(text: string): boolean { function isClaudeAuthExpiredMessage(text: string): boolean {
const normalized = text.trim().toLowerCase().replace(/\s+/g, ' '); const normalized = text.trim().toLowerCase().replace(/\s+/g, ' ');
const looksLikeAuthFailure = normalized.startsWith( const looksLikeAuthFailure = normalized.startsWith('failed to authenticate');
'failed to authenticate',
);
const hasExpiredTokenMarker = const hasExpiredTokenMarker =
normalized.includes('oauth token has expired') || normalized.includes('oauth token has expired') ||
normalized.includes('authentication_error') || normalized.includes('authentication_error') ||