{"record":{"id":"8c0a70b2dcb35a06","repo":"langchain-ai/deepagents","slug":"cron-schedules-must-be-at-least-1-minute","errorCode":null,"errorMessage":"cron schedules must be at least 1 minute","messagePattern":"cron schedules must be at least 1 minute","errorType":"validation","errorClass":"CronJobError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/cron/jobs.py","lineNumber":129,"sourceCode":"@dataclass(frozen=True, slots=True)\nclass CronSchedule:\n    \"\"\"Minute-granularity schedule for a cron job.\n\n    Args:\n        kind: Whether the schedule is one-shot or recurring.\n        minutes: Delay or interval in minutes.\n        display: Human-readable schedule text supplied by the agent.\n    \"\"\"\n\n    kind: ScheduleKind\n    minutes: int\n    display: str\n\n    def __post_init__(self) -> None:\n        \"\"\"Validate schedule granularity.\"\"\"\n        if self.minutes < MIN_GRANULARITY_MINUTES:\n            msg = \"cron schedules must be at least 1 minute\"\n            raise CronJobError(msg)\n\n    @classmethod\n    def parse(cls, value: str) -> CronSchedule:\n        \"\"\"Parse a supported schedule string.\n\n        Args:\n            value: Schedule text such as `in 30m` or `every 15m`.\n\n        Returns:\n            Parsed schedule.\n\n        Raises:\n            CronJobError: If the schedule string is unsupported.\n        \"\"\"\n        text = \" \".join(value.strip().lower().split())\n        if text.startswith(\"in \"):\n            return cls(kind=\"one_shot\", minutes=_parse_duration_minutes(text[3:]), display=value)\n        if text.startswith(\"every \"):","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/cron/jobs.py#L111-L147","documentation":"`CronSchedule.__post_init__` validates that a schedule's granularity (`minutes`) is at least `MIN_GRANULARITY_MINUTES` (1 minute). Cron-like schedules finer than one minute are unsupported by the job scheduler, so constructing a `CronSchedule` with a smaller interval raises `CronJobError` at dataclass construction time.","triggerScenarios":"Creating `CronSchedule(minutes=0)` or a negative value directly, or parsing a schedule string that resolves to sub-minute intervals via `CronSchedule.parse`.","commonSituations":"Users porting standard cron expressions that allow `* * * * *` variants or second-level schedulers (e.g. every 30s from other tools) into Talon; programmatically generating schedules with an off-by-one interval.","solutions":["Use a schedule of at least 1 minute, e.g. CronSchedule(minutes=1) or a 'every minute' schedule string.","If you need sub-minute triggering, implement it outside CronSchedule (e.g. a loop in your own scheduler) or batch work into minute-granularity jobs.","Check the parsed value: if parsing user input, clamp/round the interval up to 1 minute before constructing the dataclass."],"exampleFix":"# before\nschedule = CronSchedule(minutes=0, display='every 0 minutes')\n# after\nschedule = CronSchedule(minutes=1, display='every minute')","handlingStrategy":"validation","validationCode":"def clamp_schedule_minutes(minutes: int, min_minutes: int = 1) -> int:\n    return max(minutes, min_minutes)\n\nschedule = CronSchedule(minutes=clamp_schedule_minutes(requested_minutes), display=display)","typeGuard":"def schedule_allowed(minutes: int) -> bool:\n    return minutes >= 1","tryCatchPattern":"try:\n    schedule = CronSchedule.parse(user_input)\nexcept CronJobError as exc:\n    logging.warning(\"invalid schedule %r: %s\", user_input, exc)\n    schedule = CronSchedule(minutes=1, display=\"every minute\")","preventionTips":["Clamp user-supplied intervals to the minimum granularity before constructing CronSchedule","Reject sub-minute schedule inputs at your UI/API boundary with a clear message","Remember Talon cron granularity is minute-level; use another mechanism for sub-minute work","Unit-test parse() against boundary inputs like 0 and negative minutes"],"tags":["cron","scheduling","validation"],"backgroundTag":"invalid-cron-schedule","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}