{"record":{"id":"76e1535f57b74ba0","repo":"Hmbown/CodeWhale","slug":"automation-name-cannot-be-empty","errorCode":null,"errorMessage":"Automation name cannot be empty","messagePattern":"Automation name cannot be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":1295,"sourceCode":"    }\n\n    fn update_automation_unlocked(\n        &self,\n        id: &str,\n        req: UpdateAutomationRequest,\n    ) -> Result<AutomationRecord> {\n        let mut existing = self.get_automation(id)?;\n        let adopting = existing.execution_scope.is_none()\n            && self.execution_scope.is_some()\n            && req.status != Some(AutomationStatus::Paused);\n        if adopting {\n            existing.execution_scope = self.execution_scope.clone();\n        }\n        let schedule_changed = adopting || req.rrule.is_some() || req.status.is_some();\n\n        if let Some(name) = req.name {\n            if name.trim().is_empty() {\n                bail!(\"Automation name cannot be empty\");\n            }\n            existing.name = name.trim().to_string();\n        }\n        if let Some(prompt) = req.prompt {\n            if prompt.trim().is_empty() {\n                bail!(\"Automation prompt cannot be empty\");\n            }\n            existing.prompt = prompt.trim().to_string();\n        }\n        if let Some(rrule) = req.rrule {\n            let normalized = rrule.trim().to_ascii_uppercase();\n            AutomationSchedule::parse_rrule(&normalized)?;\n            existing.rrule = normalized;\n        }\n        if let Some(cwds) = req.cwds {\n            existing.cwds = cwds;\n        }\n        if let Some(model) = req.model {","sourceCodeStart":1277,"sourceCodeEnd":1313,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L1277-L1313","documentation":"Update-path guard in update_automation_unlocked: when the request carries a name, it must be non-blank after trimming. An empty or whitespace-only req.name is rejected before any mutation is persisted.","triggerScenarios":"Thrown at crates/tui/src/automation_manager.rs:1295 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a name containing at least one non-whitespace character.","Omit the name field from the update request if the name should not change."],"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"}