[Fix] Fast tasks cannot recover from sandbox startup failures - #1436
Conversation
|
Updated the retry design: the Fast parent now receives the complete secret-redacted error and |
| ): Promise< | ||
| { success: true; runId: number } | { success: false; error: string } | ||
| > { | ||
| const existingRetry = await db.query.taskRuns.findFirst({ |
There was a problem hiding this comment.
This check is not atomic with enqueueTaskRelaunch: two retry requests can both observe no child run and then each insert one, because task_runs.source_run_id has only a non-unique index and the enqueue path has no duplicate guard. A manual retry concurrent with the parent retry (or overlapping delivery) can therefore launch the same failed run twice, bypassing the intended two-retry budget and duplicating work. Move the idempotency guarantee into an atomic queue/database operation, such as a unique source-run constraint with conflict handling or a transaction/claim.
daniel-lxs
left a comment
There was a problem hiding this comment.
Reviewed the integrated retry path after #1435. Verified retry eligibility and budget enforcement, idempotent event redelivery, explicit action availability, and multi-task interaction. Local package suites and repository static gates pass; GitHub CI is green.
What changed
retry_task_startaction so the parent can decide whether the reported failure is worth another attempt.Why this change was made
Fast-delegated tasks previously stopped after a sandbox startup failure and required a manual restart. Their terminal lifecycle event omitted the recorded error and error code, so the parent could neither assess the failure nor request a safe relaunch.
Impact
The Fast parent now makes the retry decision from provider evidence instead of hard-coded error matching. Runtime safeguards still prevent retries after agent output, for unsupported task types, after two relaunches, or outside Fast child settlement events; other task paths are unchanged.