style: fix prettier formatting after type union refactor
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,10 @@ import {
|
|||||||
getCodexAccountCount,
|
getCodexAccountCount,
|
||||||
markCodexTokenHealthy,
|
markCodexTokenHealthy,
|
||||||
} from './codex-token-rotation.js';
|
} from './codex-token-rotation.js';
|
||||||
import type { AgentTriggerReason, CodexRotationReason } from './agent-error-detection.js';
|
import type {
|
||||||
|
AgentTriggerReason,
|
||||||
|
CodexRotationReason,
|
||||||
|
} from './agent-error-detection.js';
|
||||||
import { getTokenCount } from './token-rotation.js';
|
import { getTokenCount } from './token-rotation.js';
|
||||||
import type { RegisteredGroup } from './types.js';
|
import type { RegisteredGroup } from './types.js';
|
||||||
|
|
||||||
@@ -409,7 +412,8 @@ export async function runAgentForGroup(
|
|||||||
retryOutput.status !== 'error'
|
retryOutput.status !== 'error'
|
||||||
) {
|
) {
|
||||||
trigger = {
|
trigger = {
|
||||||
reason: retryAttempt.streamedTriggerReason.reason as CodexRotationReason,
|
reason: retryAttempt.streamedTriggerReason
|
||||||
|
.reason as CodexRotationReason,
|
||||||
};
|
};
|
||||||
lastRotationMessage =
|
lastRotationMessage =
|
||||||
typeof retryOutput.result === 'string'
|
typeof retryOutput.result === 'string'
|
||||||
@@ -422,8 +426,8 @@ export async function runAgentForGroup(
|
|||||||
const retryTrigger = retryAttempt.streamedTriggerReason
|
const retryTrigger = retryAttempt.streamedTriggerReason
|
||||||
? {
|
? {
|
||||||
shouldRotate: true,
|
shouldRotate: true,
|
||||||
reason:
|
reason: retryAttempt.streamedTriggerReason
|
||||||
retryAttempt.streamedTriggerReason.reason as CodexRotationReason,
|
.reason as CodexRotationReason,
|
||||||
}
|
}
|
||||||
: detectCodexRotationTrigger(retryOutput.error);
|
: detectCodexRotationTrigger(retryOutput.error);
|
||||||
|
|
||||||
@@ -672,7 +676,8 @@ export async function runAgentForGroup(
|
|||||||
) {
|
) {
|
||||||
return retryCodexWithRotation(
|
return retryCodexWithRotation(
|
||||||
{
|
{
|
||||||
reason: primaryAttempt.streamedTriggerReason.reason as CodexRotationReason,
|
reason: primaryAttempt.streamedTriggerReason
|
||||||
|
.reason as CodexRotationReason,
|
||||||
},
|
},
|
||||||
output.error ?? output.result ?? undefined,
|
output.error ?? output.result ?? undefined,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -54,12 +54,12 @@ export function evaluateStreamedOutput(
|
|||||||
) {
|
) {
|
||||||
const triggerReason: AgentTriggerReason | undefined =
|
const triggerReason: AgentTriggerReason | undefined =
|
||||||
isClaudeUsageExhaustedMessage(output.result)
|
isClaudeUsageExhaustedMessage(output.result)
|
||||||
? 'usage-exhausted'
|
? 'usage-exhausted'
|
||||||
: isClaudeOrgAccessDeniedMessage(output.result)
|
: isClaudeOrgAccessDeniedMessage(output.result)
|
||||||
? 'org-access-denied'
|
? 'org-access-denied'
|
||||||
: isClaudeAuthExpiredMessage(output.result)
|
: isClaudeAuthExpiredMessage(output.result)
|
||||||
? 'auth-expired'
|
? 'auth-expired'
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
if (triggerReason) {
|
if (triggerReason) {
|
||||||
const newTrigger = nextState.streamedTriggerReason
|
const newTrigger = nextState.streamedTriggerReason
|
||||||
|
|||||||
@@ -49,7 +49,10 @@ import {
|
|||||||
getCodexAccountCount,
|
getCodexAccountCount,
|
||||||
markCodexTokenHealthy,
|
markCodexTokenHealthy,
|
||||||
} from './codex-token-rotation.js';
|
} from './codex-token-rotation.js';
|
||||||
import type { AgentTriggerReason, CodexRotationReason } from './agent-error-detection.js';
|
import type {
|
||||||
|
AgentTriggerReason,
|
||||||
|
CodexRotationReason,
|
||||||
|
} from './agent-error-detection.js';
|
||||||
import {
|
import {
|
||||||
getTokenCount,
|
getTokenCount,
|
||||||
markTokenHealthy,
|
markTokenHealthy,
|
||||||
@@ -520,7 +523,8 @@ async function runTask(
|
|||||||
retryAttempt.output.status !== 'error'
|
retryAttempt.output.status !== 'error'
|
||||||
) {
|
) {
|
||||||
trigger = {
|
trigger = {
|
||||||
reason: retryAttempt.streamedTriggerReason.reason as CodexRotationReason,
|
reason: retryAttempt.streamedTriggerReason
|
||||||
|
.reason as CodexRotationReason,
|
||||||
};
|
};
|
||||||
lastRotationMessage =
|
lastRotationMessage =
|
||||||
typeof retryAttempt.output.result === 'string'
|
typeof retryAttempt.output.result === 'string'
|
||||||
@@ -533,8 +537,8 @@ async function runTask(
|
|||||||
const retryTrigger = retryAttempt.streamedTriggerReason
|
const retryTrigger = retryAttempt.streamedTriggerReason
|
||||||
? {
|
? {
|
||||||
shouldRotate: true,
|
shouldRotate: true,
|
||||||
reason:
|
reason: retryAttempt.streamedTriggerReason
|
||||||
retryAttempt.streamedTriggerReason.reason as CodexRotationReason,
|
.reason as CodexRotationReason,
|
||||||
}
|
}
|
||||||
: detectCodexRotationTrigger(
|
: detectCodexRotationTrigger(
|
||||||
retryAttempt.attemptError || retryAttempt.output.error,
|
retryAttempt.attemptError || retryAttempt.output.error,
|
||||||
@@ -618,7 +622,8 @@ async function runTask(
|
|||||||
const trigger = attempt.streamedTriggerReason
|
const trigger = attempt.streamedTriggerReason
|
||||||
? {
|
? {
|
||||||
shouldRotate: true,
|
shouldRotate: true,
|
||||||
reason: attempt.streamedTriggerReason.reason as CodexRotationReason,
|
reason: attempt.streamedTriggerReason
|
||||||
|
.reason as CodexRotationReason,
|
||||||
}
|
}
|
||||||
: detectCodexRotationTrigger(error);
|
: detectCodexRotationTrigger(error);
|
||||||
if (trigger.shouldRotate) {
|
if (trigger.shouldRotate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user