Call recorder: recovery re-sends bot creations after Recall has forgotten the idempotency key
Author: vladbisceanuCreated Sep 28, 2026Updated Sep 28, 2026
Bug Description
canRescheduleCallRecordingWithoutRecallLookup trusts a re-send of a recorded bot creation for 12 hours (IDEMPOTENT_RESEND_WINDOW_HOURS = 12), on the assumption that Recall does not document how long it keeps idempotency keys. Recall does document it: a key replays its first response only if the matching request completed "in the previous hour" (https://docs.recall.ai/reference/idempotency.md).
Failure sequence:
scheduleRecallBotForCallRecordingrecords the attempt markers and POSTs/bot/; Recall creates the bot.- The run dies before writing
externalBotIdback (timeout, crash, lost response). - The recovery cron runs between 1 and 12 hours later, sees a fresh-enough attempt whose key still matches, and re-sends the creation with the same key instead of looking the bot up.
- Recall no longer knows the key and creates a second bot, so two recorders join the meeting and both are billed.
Expected behavior
A re-send is only trusted while Recall still remembers the key; after that, recovery takes the existing Recall lookup path (findScheduledRecallBotIdsByCallRecordingId) and attaches the bot it finds.
Technical inputs
- Lowering the window below one hour (with some margin for clock skew and queue delay) keeps the fast path for immediate retries and sends everything older through the lookup.
- This overlaps with the attempt-key changes in #26818, so we will open the PR once that one is settled.
Source: twentyhq/twenty