style: format agent rotation updates
This commit is contained in:
@@ -20,10 +20,7 @@ import {
|
||||
} from './platform-prompts.js';
|
||||
import type { AgentType, RegisteredGroup } from './types.js';
|
||||
|
||||
function writeCodexApiKeyAuth(
|
||||
authPath: string,
|
||||
openaiKey: string,
|
||||
): void {
|
||||
function writeCodexApiKeyAuth(authPath: string, openaiKey: string): void {
|
||||
fs.writeFileSync(
|
||||
authPath,
|
||||
JSON.stringify(
|
||||
|
||||
@@ -621,7 +621,9 @@ export class GroupQueue {
|
||||
if (graceWaitMs > 0) {
|
||||
await Promise.race([
|
||||
Promise.all(
|
||||
activeProcesses.map(({ process }) => this.waitForProcessExit(process)),
|
||||
activeProcesses.map(({ process }) =>
|
||||
this.waitForProcessExit(process),
|
||||
),
|
||||
),
|
||||
new Promise((resolve) => setTimeout(resolve, graceWaitMs)),
|
||||
]);
|
||||
|
||||
@@ -74,9 +74,7 @@ function isClaudeUsageExhaustedMessage(text: string): boolean {
|
||||
|
||||
function isClaudeAuthExpiredMessage(text: string): boolean {
|
||||
const normalized = text.trim().toLowerCase().replace(/\s+/g, ' ');
|
||||
const looksLikeAuthFailure = normalized.startsWith(
|
||||
'failed to authenticate',
|
||||
);
|
||||
const looksLikeAuthFailure = normalized.startsWith('failed to authenticate');
|
||||
const hasExpiredTokenMarker =
|
||||
normalized.includes('oauth token has expired') ||
|
||||
normalized.includes('authentication_error') ||
|
||||
|
||||
@@ -104,7 +104,9 @@ describe('provider fallback usage recovery', () => {
|
||||
|
||||
it('treats terminated 401 auth failures as an auth-expired fallback trigger', () => {
|
||||
expect(
|
||||
detectFallbackTrigger('Failed to authenticate. API Error: 401 terminated'),
|
||||
detectFallbackTrigger(
|
||||
'Failed to authenticate. API Error: 401 terminated',
|
||||
),
|
||||
).toEqual({
|
||||
shouldFallback: true,
|
||||
reason: 'auth-expired',
|
||||
|
||||
@@ -94,9 +94,7 @@ function isClaudeUsageExhaustedMessage(text: string): boolean {
|
||||
|
||||
function isClaudeAuthExpiredMessage(text: string): boolean {
|
||||
const normalized = text.trim().toLowerCase().replace(/\s+/g, ' ');
|
||||
const looksLikeAuthFailure = normalized.startsWith(
|
||||
'failed to authenticate',
|
||||
);
|
||||
const looksLikeAuthFailure = normalized.startsWith('failed to authenticate');
|
||||
const hasExpiredTokenMarker =
|
||||
normalized.includes('oauth token has expired') ||
|
||||
normalized.includes('authentication_error') ||
|
||||
|
||||
Reference in New Issue
Block a user