mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 19:34:29 +00:00
Vercel's command POST has no idempotency key, so a retry after a lost answer (dropped connection, gateway 5xx, a Worker that died mid-request) can start the command again (vercel/sandbox#363). Message delivery did exactly that: a transient failure re-queued the message and the cron typed it into the agent again, or launched a second agent. - command-once.ts: an in-VM guard with a per-id ledger (mkdir claim, recorded exit + output). A repeat of the same id waits for and replays the first run; a dead first run reports an unknown outcome; a failed run is forgotten so a retry runs for real. runCommandOnce retries uncertain provider failures with the same id (never a 4xx that proves the command did not start). - deliverMessage uses msg-<id> for send/launch; an unknown outcome fails the message (delivery_outcome_unknown) instead of re-sending. - POST /messages and POST /sessions take Idempotency-Key (same semantics as workspace create); a session create taking over a died attempt replays the first launch. - The REST client keeps sending each command POST exactly once (test).