Hmbown/CodeWhale · error · anyhow::Error

Automation name cannot be empty

Error message

Automation name cannot be empty

What it means

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.

Solutions

  1. Supply a name containing at least one non-whitespace character.
  2. Omit the name field from the update request if the name should not change.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/automation_manager.rs:1295 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/76e1535f57b74ba0. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/automation_manager.rs:1295

    }

    fn update_automation_unlocked(
        &self,
        id: &str,
        req: UpdateAutomationRequest,
    ) -> Result<AutomationRecord> {
        let mut existing = self.get_automation(id)?;
        let adopting = existing.execution_scope.is_none()
            && self.execution_scope.is_some()
            && req.status != Some(AutomationStatus::Paused);
        if adopting {
            existing.execution_scope = self.execution_scope.clone();
        }
        let schedule_changed = adopting || req.rrule.is_some() || req.status.is_some();

        if let Some(name) = req.name {
            if name.trim().is_empty() {
                bail!("Automation name cannot be empty");
            }
            existing.name = name.trim().to_string();
        }
        if let Some(prompt) = req.prompt {
            if prompt.trim().is_empty() {
                bail!("Automation prompt cannot be empty");
            }
            existing.prompt = prompt.trim().to_string();
        }
        if let Some(rrule) = req.rrule {
            let normalized = rrule.trim().to_ascii_uppercase();
            AutomationSchedule::parse_rrule(&normalized)?;
            existing.rrule = normalized;
        }
        if let Some(cwds) = req.cwds {
            existing.cwds = cwds;
        }
        if let Some(model) = req.model {

View on GitHub (pinned to 73e0f67d83)