fix: use ignoreRateLimits in retryClaudeWithRotation loops

Without this, token rotation was blocked by stale cooldowns even
when the target token had available usage.
This commit is contained in:
Eyejoker
2026-03-24 03:47:22 +09:00
parent 120f16e9e1
commit 6a73421d4f
2 changed files with 30 additions and 30 deletions

View File

@@ -351,7 +351,7 @@ export async function runAgentForGroup(
while (
shouldRotateClaudeToken(trigger.reason) &&
getTokenCount() > 1 &&
rotateToken(lastRotationMessage)
rotateToken(lastRotationMessage, { ignoreRateLimits: true })
) {
logger.info(
{ chatJid, group: group.name, runId, reason: trigger.reason },
@@ -422,7 +422,9 @@ export async function runAgentForGroup(
retryAfterMs: retryAttempt.streamedTriggerReason.retryAfterMs,
};
lastRotationMessage =
typeof retryOutput.result === 'string' ? retryOutput.result : undefined;
typeof retryOutput.result === 'string'
? retryOutput.result
: undefined;
continue;
}