NousResearch/hermes-agent · error · ValueError

Cron job field(s) cannot be updated: {', '.join(sorted(bad_f

Error message

Cron job field(s) cannot be updated: {', '.join(sorted(bad_fields))}

What it means

Error "Cron job field(s) cannot be updated: {', '.join(sorted(bad_fields))}" thrown in NousResearch/hermes-agent.

Source

Thrown at cron/jobs.py:1865

    try:
        from cron.executions import latest_executions

        latest = latest_executions([job.get("id", "") for job in jobs])
    except Exception:
        latest = {}
    for job in jobs:
        job["latest_execution"] = latest.get(job.get("id", ""))
    return jobs


def update_job(job_id: str, updates: Dict[str, Any]) -> Optional[Dict[str, Any]]:
    """Update a job by ID, refreshing derived schedule fields when needed."""
    # Block mutation of immutable fields. ``id`` in particular is a filesystem
    # path component under OUTPUT_DIR — letting an update change it leaks
    # path-escape values into output writes/deletes.
    bad_fields = _IMMUTABLE_JOB_FIELDS.intersection(updates or {})
    if bad_fields:
        raise ValueError(
            f"Cron job field(s) cannot be updated: {', '.join(sorted(bad_fields))}"
        )

    with _jobs_lock():
        jobs = load_jobs()
        for i, job in enumerate(jobs):
            if job["id"] != job_id:
                continue

            # Validate / normalize workdir if present in updates.  Empty string
            # or None both mean "clear the field" (restore old behaviour).
            if "workdir" in updates:
                _wd = updates["workdir"]
                if _wd in {None, "", False}:
                    updates["workdir"] = None
                else:
                    updates["workdir"] = _normalize_workdir(_wd)

View on GitHub (pinned to c896c09c42)

Solutions

  1. Update only editable cron job fields; remove the listed fields from the update.

When it happens

Trigger: Thrown at cron/jobs.py:1865 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/5f575cc1cc72e6d4. Report an issue: GitHub.