fix(letta-api): restore 429 rethrow in rejectApproval

Re-throws rate limit errors so callers bail out early instead of
hammering the API in a tight loop. This was accidentally dropped
during the merge.
This commit is contained in:
Ani Tunturi
2026-03-17 13:43:17 -04:00
committed by Ani
parent e451901ea1
commit 9af2d2625f

View File

@@ -550,6 +550,12 @@ export async function rejectApproval(
log.warn(`Approval already resolved for tool call ${approval.toolCallId}`); log.warn(`Approval already resolved for tool call ${approval.toolCallId}`);
return true; return true;
} }
// Re-throw rate limit errors so callers can bail out early instead of
// hammering the API in a tight loop.
if (err?.status === 429) {
log.error('Failed to reject approval:', e);
throw e;
}
log.error('Failed to reject approval:', e); log.error('Failed to reject approval:', e);
return false; return false;
} }