Summary
Script cron jobs (payload.kind: "script") currently run via execCronScript and return a bare CronRunOutcome with no delivered/deliveryAttempted fields. The announce/delivery pipeline is never invoked.
Problem
agentTurn jobs get delivery via runIsolatedAgentJob which bundles the full run + announce in one dep call. There is no equivalent dep for script output delivery. As a result, --announce / --channel / --to flags are accepted at CLI creation time but silently have no effect at runtime.
Acceptance Criteria
- A new
CronServiceDeps function (e.g. sendCronScriptResult) allows delivering script stdout to a configured channel
executeJobCore calls it after execCronScript returns when delivery is requested
delivered and deliveryAttempted are correctly populated in the returned result
- Existing script jobs without delivery config are unaffected
Implementation Plan
- Add
sendCronScriptResult (or similar) to CronServiceDeps in state.ts
- Implement the dep in the gateway (reuse announce machinery from isolated job delivery)
- In
executeJobCore, after execCronScript, call the dep when resolveCronDeliveryPlan(job).requested
- Return
{ ...scriptResult, delivered, deliveryAttempted } from the script branch
Files Affected
src/cron/service/state.ts — new dep
src/cron/service/timer.ts — call dep after execCronScript
- Gateway wiring (wherever
runIsolatedAgentJob dep is implemented)
Summary
Script cron jobs (
payload.kind: "script") currently run viaexecCronScriptand return a bareCronRunOutcomewith nodelivered/deliveryAttemptedfields. The announce/delivery pipeline is never invoked.Problem
agentTurnjobs get delivery viarunIsolatedAgentJobwhich bundles the full run + announce in one dep call. There is no equivalent dep for script output delivery. As a result,--announce/--channel/--toflags are accepted at CLI creation time but silently have no effect at runtime.Acceptance Criteria
CronServiceDepsfunction (e.g.sendCronScriptResult) allows delivering script stdout to a configured channelexecuteJobCorecalls it afterexecCronScriptreturns when delivery is requesteddeliveredanddeliveryAttemptedare correctly populated in the returned resultImplementation Plan
sendCronScriptResult(or similar) toCronServiceDepsinstate.tsexecuteJobCore, afterexecCronScript, call the dep whenresolveCronDeliveryPlan(job).requested{ ...scriptResult, delivered, deliveryAttempted }from the script branchFiles Affected
src/cron/service/state.ts— new depsrc/cron/service/timer.ts— call dep afterexecCronScriptrunIsolatedAgentJobdep is implemented)