style: prettier formatting

This commit is contained in:
Eyejoker
2026-03-24 01:37:14 +09:00
parent 92c82c192a
commit c51d80bd07
3 changed files with 18 additions and 6 deletions

View File

@@ -184,7 +184,8 @@ function prepareCodexSessionEnvironment(args: {
fs.mkdirSync(sessionCodexDir, { recursive: true }); fs.mkdirSync(sessionCodexDir, { recursive: true });
const rotatedAuthSrc = getActiveCodexAuthPath(); const rotatedAuthSrc = getActiveCodexAuthPath();
const authSrc = rotatedAuthSrc && fs.existsSync(rotatedAuthSrc) const authSrc =
rotatedAuthSrc && fs.existsSync(rotatedAuthSrc)
? rotatedAuthSrc ? rotatedAuthSrc
: path.join(hostCodexDir, 'auth.json'); : path.join(hostCodexDir, 'auth.json');
const authDst = path.join(sessionCodexDir, 'auth.json'); const authDst = path.join(sessionCodexDir, 'auth.json');

View File

@@ -164,12 +164,20 @@ function loadCodexState(): void {
} }
} }
if (Array.isArray(state.resetAts)) { if (Array.isArray(state.resetAts)) {
for (let i = 0; i < Math.min(state.resetAts.length, accounts.length); i++) { for (
let i = 0;
i < Math.min(state.resetAts.length, accounts.length);
i++
) {
if (state.resetAts[i]) accounts[i].resetAt = state.resetAts[i]; if (state.resetAts[i]) accounts[i].resetAt = state.resetAts[i];
} }
} }
if (Array.isArray(state.resetD7Ats)) { if (Array.isArray(state.resetD7Ats)) {
for (let i = 0; i < Math.min(state.resetD7Ats.length, accounts.length); i++) { for (
let i = 0;
i < Math.min(state.resetD7Ats.length, accounts.length);
i++
) {
if (state.resetD7Ats[i]) accounts[i].resetD7At = state.resetD7Ats[i]; if (state.resetD7Ats[i]) accounts[i].resetD7At = state.resetD7Ats[i];
} }
} }

View File

@@ -401,7 +401,10 @@ export async function runAgentForGroup(
// Codex rate-limit rotation (non-Claude agents) // Codex rate-limit rotation (non-Claude agents)
if (!isClaudeCodeAgent && getCodexAccountCount() > 1) { if (!isClaudeCodeAgent && getCodexAccountCount() > 1) {
const trigger = detectFallbackTrigger(output.error); const trigger = detectFallbackTrigger(output.error);
if (trigger.shouldFallback && rotateCodexToken(output.error ?? undefined)) { if (
trigger.shouldFallback &&
rotateCodexToken(output.error ?? undefined)
) {
logger.info( logger.info(
{ chatJid, group: group.name, runId, reason: trigger.reason }, { chatJid, group: group.name, runId, reason: trigger.reason },
'Codex rate-limited, retrying with rotated account', 'Codex rate-limited, retrying with rotated account',