{"record":{"id":"b51dc04349017874","repo":"tinyhumansai/openhuman","slug":"flow-type-cron-jobs-are-managed-by-the-workflows-f","errorCode":null,"errorMessage":"flow-type cron jobs are managed by the Workflows feature and cannot be created via cron_add","messagePattern":"flow-type cron jobs are managed by the Workflows feature and cannot be created via cron_add","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/cron/tools/add.rs","lineNumber":363,"sourceCode":"                cron::add_agent_job(\n                    &self.config,\n                    name,\n                    schedule,\n                    prompt,\n                    session_target,\n                    model,\n                    delivery,\n                    delete_after_run,\n                )\n            }\n            // `job_type` above is derived only from `Some(\"agent\")`/`Some(\"shell\")`/\n            // the `prompt`-presence heuristic, so this arm is unreachable in\n            // practice — `JobType::Flow` rows are created internally by\n            // `flows::ops::flows_set_enabled` (via `cron::add_flow_schedule_job`),\n            // never through this agent-facing tool. Kept as an explicit error\n            // (not `unreachable!()`) so a future change to the heuristic above\n            // fails loudly with a clear message instead of panicking.\n            JobType::Flow => Err(anyhow::anyhow!(\n                \"flow-type cron jobs are managed by the Workflows feature and cannot be \\\n                 created via cron_add\"\n            )),\n        };\n\n        match result {\n            Ok(job) => {\n                let payload = json!({\n                    \"id\": job.id,\n                    \"name\": job.name,\n                    \"job_type\": job.job_type,\n                    \"schedule\": job.schedule,\n                    \"next_run\": job.next_run,\n                    \"enabled\": job.enabled\n                });\n                let mut tr = ToolResult::success(serde_json::to_string_pretty(&payload)?);\n                if options.prefer_markdown {\n                    let md = format!(","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/cron/tools/add.rs#L345-L381","documentation":"cron_add attempted to create a job whose derived JobType is Flow. Flow-type rows are owned by the Workflows feature (created internally by flows_set_enabled), so the cron tool refuses them by design. The arm is documented as practically unreachable via normal argument derivation — reaching it means an internal caller misrouted a flow job.","triggerScenarios":"Thrown at src/openhuman/cron/tools/add.rs:363 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create or enable workflow-triggered schedules through the Workflows/flows feature instead of cron_add","Do not attempt to inject flow jobs through the cron tool surface"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}