Unify codex rotation retry guards

This commit is contained in:
ejclaw
2026-04-06 20:53:48 +09:00
parent 7612b2c4cc
commit fdc27836a3
5 changed files with 94 additions and 80 deletions

View File

@@ -126,6 +126,18 @@ export function shouldRotateClaudeToken(
);
}
export function isCodexRotationReason(
reason: AgentTriggerReason,
): reason is CodexRotationReason {
return (
reason === '429' ||
reason === 'auth-expired' ||
reason === 'org-access-denied' ||
reason === 'overloaded' ||
reason === 'network-error'
);
}
// ── Rotation trigger classification ─────────────────────────────
export type RotationTriggerResult =