{"record":{"id":"6890007254c599be","repo":"Hmbown/CodeWhale","slug":"automation-execution-ownership-is-unverified","errorCode":null,"errorMessage":"Automation execution ownership is unverified","messagePattern":"Automation execution ownership is unverified","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":2084,"sourceCode":"        model_provider_id: automation.model_provider_id.clone(),\n        workspace: automation.cwds.first().cloned(),\n        mode: Some(automation.task_mode()),\n        allow_shell: Some(automation.task_allow_shell()),\n        trust_mode: Some(automation.task_trust_mode()),\n        auto_approve: Some(automation.task_auto_approve()),\n        permission_posture: Some(automation_posture(automation.task_auto_approve())),\n        owner_session_id: None,\n    }\n}\n\nfn bind_run_dispatch(\n    run: &mut AutomationRunRecord,\n    automation: &AutomationRecord,\n    task_data_dir: &Path,\n    scheduled: bool,\n) -> Result<()> {\n    if automation.execution_scope.is_none() {\n        bail!(\"Automation execution ownership is unverified\");\n    }\n    run.schema_version = CURRENT_RUN_SCHEMA_VERSION;\n    run.task_id = Some(crate::task_manager::TaskManager::new_task_id());\n    run.dispatch = Some(AutomationDispatch {\n        execution_scope: automation.execution_scope.clone(),\n        request: automation_task_request(automation),\n        task_data_dir: task_data_dir\n            .canonicalize()\n            .context(\"resolve task store before automation admission\")?,\n        accepted: false,\n        delivery_mode: automation.delivery_mode(),\n        suppress_report: false,\n        schedule: scheduled.then(|| AdmittedSchedule {\n            updated_at: automation.updated_at,\n            rrule: automation.rrule.clone(),\n        }),\n    });\n    Ok(())","sourceCodeStart":2066,"sourceCodeEnd":2102,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L2066-L2102","documentation":"adopt_for_run's scope precondition: the automation manager's execution ownership is unverified (no execution scope recorded), so the runtime refuses to run the automation rather than executing it under unknown ownership.","triggerScenarios":"Thrown at crates/tui/src/automation_manager.rs:2084 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Bind the Runtime's execution scope before adopting automations for a run (see adopt_for_run).","Recover the automation under the Runtime instance that originally owns it so execution_scope is set."],"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"}