/upload has no idempotency: a retried upload re-runs Whisper/Gemini/correlation on the same call_id #302

Closed
opened 2026-10-27 20:14:57 -04:00 by logan · 1 comment
Owner

Found by drb-audio-review on node-26#44 (edge branch fix/44-upload-spool, commit 6b884d5).

The edge node now retries uploads. If C2 already wrote to GCS but the node timed out or was stopped before reading the response, the node counts it as failed and uploads again. routers/upload.py (~L69-110) has no idempotency check, so the retry runs transcription, extraction and correlation a second time for the same call_id. That is double AI spend (corrupts the server-26#45 cost measurement) and the same double-link shape as server-26#131.

Fix: in /upload, still write the new GCS object, but skip the pipeline when the call doc already has audio_gcs_uri or intelligence_started_at.

Found by drb-audio-review on node-26#44 (edge branch `fix/44-upload-spool`, commit 6b884d5). The edge node now retries uploads. If C2 already wrote to GCS but the node timed out or was stopped before reading the response, the node counts it as failed and uploads again. `routers/upload.py` (~L69-110) has no idempotency check, so the retry runs transcription, extraction and correlation a second time for the same call_id. That is double AI spend (corrupts the server-26#45 cost measurement) and the same double-link shape as server-26#131. Fix: in /upload, still write the new GCS object, but skip the pipeline when the call doc already has `audio_gcs_uri` or `intelligence_started_at`.
logan added the
type
bug
area/correlationarea/ai-pipeline
priority
p2
kind
behavior-bug
labels 2026-10-27 20:14:57 -04:00
Author
Owner

Fixed in ec35d80, deployed to prod as 4fab959 on 2026-11-08 (/health confirms).

Fixed in ec35d80, deployed to prod as 4fab959 on 2026-11-08 (/health confirms).
logan removed the
priority
p2
label 2026-11-08 21:51:17 -05:00
logan closed this issue 2026-11-08 21:51:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logan/server-26#302