style: format agent rotation updates
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
@@ -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)),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -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') ||
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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') ||
|
||||||
|
|||||||
Reference in New Issue
Block a user