{"record":{"id":"ceb08d2516f345a0","repo":"Hmbown/CodeWhale","slug":"automation-run-has-no-durable-task-binding","errorCode":null,"errorMessage":"Automation run has no durable task binding","messagePattern":"Automation run has no durable task binding","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":2147,"sourceCode":"            .recover_task_admission(dispatch.request.clone(), task_id.to_owned())\n            .await?\n    };\n    crate::task_manager::validate_bound_task_request(&task, &dispatch.request)?;\n    dispatch.accepted = true;\n    dispatch.suppress_report = dispatch.delivery_mode == AutomationDeliveryMode::Watcher\n        && task.status == TaskStatus::Completed\n        && task\n            .result_summary\n            .as_deref()\n            .is_some_and(|summary| summary.trim() == AUTOMATION_WATCHER_NO_REPORT_SENTINEL);\n    Ok(task)\n}\n\n/// Caller owns dispatch.lock and has already persisted this exact binding.\nasync fn enqueue_run_task(run: &mut AutomationRunRecord, tasks: &SharedTaskManager) {\n    let result = match (&mut run.dispatch, &run.task_id) {\n        (Some(dispatch), Some(task_id)) => dispatch_bound_task(dispatch, task_id, tasks).await,\n        _ => Err(anyhow::anyhow!(\n            \"Automation run has no durable task binding\"\n        )),\n    };\n    match result {\n        Ok(task) => {\n            run.error = None;\n            apply_task_status(run, &task);\n        }\n        Err(error) => {\n            // Keep the same pending identity after uncertain admission. A later\n            // tick first looks for its canonical task; no new id is allocated.\n            run.error = Some(format!(\n                \"Automation task admission needs recovery: {error:#}\"\n            ));\n        }\n    }\n}\n","sourceCodeStart":2129,"sourceCodeEnd":2165,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L2129-L2165","documentation":"Dispatch recovery guard: an automation run reached execution without a durable task binding, so the runtime cannot validate or resume the run's bound task and refuses the dispatch rather than starting an untracked task.","triggerScenarios":"Thrown at crates/tui/src/automation_manager.rs:2147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Recover or re-create the task binding for the run before dispatching.","If the run record is corrupt, re-register the automation so dispatch.request and task_id are persisted together."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}