zeroclaw-labs/zeroclaw · error · anyhow::Error

No cron job found with id or name

Error message

No cron job found with id or name '{id_or_name}'

What it means

Lookup failure in resolve_job_id_or_name: the input matched neither a job id (exact lookup fast path) nor the name of any job owned by the requesting agent. Name search is deliberately scoped to the agent's own jobs, so another agent's job name resolves the same way an unknown one does.

Solutions

  1. Check the job ID or name spelling; list existing cron jobs to find it.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/zeroclaw-runtime/src/cron/store.rs:277 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/024785769646fa2b. Report an issue: GitHub.

Appendix: source

Thrown at crates/zeroclaw-runtime/src/cron/store.rs:277

    config: &Config,
    id_or_name: &str,
    agent_alias: &str,
) -> Result<String> {
    // Fast path: try exact ID lookup first.
    if let Ok(job) = get_job(config, id_or_name) {
        return Ok(job.id);
    }

    // Fallback: search by name within the requesting agent's own jobs.
    let jobs = list_jobs_by_agent(config, agent_alias)?;
    let lower = id_or_name.to_lowercase();
    let matches: Vec<&CronJob> = jobs
        .iter()
        .filter(|j| j.name.as_deref().is_some_and(|n| n.to_lowercase() == lower))
        .collect();

    match matches.len() {
        0 => anyhow::bail!("No cron job found with id or name '{id_or_name}'"),
        1 => Ok(matches[0].id.clone()),
        n => anyhow::bail!(
            "Ambiguous name '{id_or_name}': matched {n} jobs — use the job ID instead"
        ),
    }
}

pub fn remove_job(config: &Config, id: &str) -> Result<()> {
    let changed = with_initialized_connection(config, |conn| {
        conn.execute("DELETE FROM cron_jobs WHERE id = ?1", params![id])
            .context("Failed to delete cron job")
    })?;

    if changed == 0 {
        anyhow::bail!("Cron job '{id}' not found");
    }

    ::zeroclaw_log::record!(

View on GitHub (pinned to 88bb9c8533)