fix(tasks): persist work-order waits without restarting runs
Dispatch receipts previously requeued active investigations and the final-only completion gate then failed waiting generations. Preserve the run, accept current interim wait reports, and wake only on actionable feedback or recovery evidence. Regression tests cover dispatch, same-generation reports, receipt revisions, cancellation and replacement ordering.
This commit is contained in:
@@ -114,7 +114,7 @@ async def sync_once(client: httpx.AsyncClient, settings: WorkerSettings, periphe
|
||||
existing[task["source"].get("external_id")] = task
|
||||
elif task["task_type"] == "event_investigation":
|
||||
event_tasks[task.get("source", {}).get("external_id")] = task
|
||||
if task["status"] in {"queued", "waiting_human", "running"} or (
|
||||
if task["status"] in {"queued", "waiting_human", "running", "failed"} or (
|
||||
work_order_ids is not None and task["status"] == "completed"
|
||||
):
|
||||
investigations[task["task_id"]] = task
|
||||
|
||||
Reference in New Issue
Block a user