{"record":{"id":"0b35eab4bfe65eb7","repo":"tinyhumansai/openhuman","slug":"delivery-to-is-required-for-announce-mode","errorCode":null,"errorMessage":"delivery.to is required for announce mode","messagePattern":"delivery\\.to is required for announce mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/cron/scheduler.rs","lineNumber":1349,"sourceCode":"                BUS.publish(DomainEvent::ProactiveMessageRequested {\n                    source,\n                    message: output.to_string(),\n                    job_name: job.name.clone(),\n                });\n            }\n        }\n\n        // Announce delivery — the cron job specifies the exact channel\n        // and target. Used for explicit channel-targeted output.\n        \"announce\" if deliver_to_chat => {\n            let channel = delivery\n                .channel\n                .as_deref()\n                .ok_or_else(|| anyhow::anyhow!(\"delivery.channel is required for announce mode\"))?;\n            let target = delivery\n                .to\n                .as_deref()\n                .ok_or_else(|| anyhow::anyhow!(\"delivery.to is required for announce mode\"))?;\n\n            tracing::debug!(\n                job_id = %job.id,\n                channel = %channel,\n                target = %target,\n                \"[cron] publishing CronDeliveryRequested event\"\n            );\n            BUS.publish(DomainEvent::CronDeliveryRequested {\n                job_id: job.id.clone(),\n                channel: channel.to_string(),\n                target: target.to_string(),\n                output: output.to_string(),\n            });\n        }\n\n        // No delivery configured — output is stored in last_output only.\n        // The failure still reaches the alerts tab via the hoisted\n        // `push_cron_alert` below.","sourceCodeStart":1331,"sourceCodeEnd":1367,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/cron/scheduler.rs#L1331-L1367","documentation":"A cron job with delivery mode `announce` has `delivery.channel` set but no `delivery.to` target — the recipient inside the channel is missing. Companion guard to the channel check; both must be present for announce mode, and the scheduler refuses to pick a default recipient.","triggerScenarios":"Thrown at src/openhuman/cron/scheduler.rs:1349 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set delivery.to to the target recipient (chat/thread/user id) for announce delivery"],"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"}