Repository navigation
Closed
Labels
enhancementNew feature or request
Description
What problem does this solve?
Part of the gateway epic (#910). Cron delivery targets today are log, session, file:PATH and command:ARGV (crates/tole-cli/src/cron/deliver.rs). There is no outbound push to a client, and approval requests are not pushed either. A chat gateway would have to hold one SSE stream per session (the server caps streams at 8) or poll GET /cron/runs and GET /approvals. A command: target could shell out to curl, but it is only allowed for trusted jobs and is not signed.
Proposed solution
Owner decision 2026-11-17: add an outbound webhook delivery target so cron results and approval requests reach a gateway without holding streams.
- A named destination is declared in the user config only (never in a project config and never chosen by a job or by agent-written text): URL, secret source (env or the existing secret mechanism, never inline), optional allowed events. A cron job refers to it by name, for example
delivery = "webhook:gateway". - Events: a finished cron run (result summary, job, run id, status) and
approval_requested/approval_resolvedfor approvals that park a run or a session turn (approval id, tool, risk tier, session id). - Payload goes through
SecretSet::redactlike every other sink, is size-capped, and carries a stable event id (idempotency key). - Authentication: HMAC-SHA256 over timestamp + body in headers, in the same style as the inbound
POST /hooks/<route>gate (feat(serve): webhook routes that fire cron jobs (HMAC, idempotency, filters) #582), so a receiver can verify and reject replays. - Delivery: at-least-once with bounded retries and backoff, then a ledger line and a doctor warning; delivery never blocks the turn or the cron tick.
- Network policy: only the destinations named in the user config are reachable; loopback must be allowed explicitly (a local gateway needs it); redirects are not followed; no private-range access unless the destination is configured for it.
- Design before code: a short design note in
docs/automation-design.mdfirst, then implementation. This touches an outbound data path, so it needs an independent read-only review before the PR is opened, andcora callers/impactoutput in the PR body.
Alternatives considered
- The gateway polls
GET /cron/runsandGET /approvals: no kernel change, but latency and wasted requests; usable as a fallback. - The gateway holds SSE streams: hits the cap of 8 and loses ephemeral frames on reconnect.
command:target with curl: unsigned and trusted-jobs-only.
Are you willing to contribute the implementation?
Yes, I can do it
Before submitting
- I searched existing issues and didn't find a duplicate
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
docs(automation): revise webhook delivery design after independent re…
docs(automation): second revision of the webhook delivery design (#911)
docs(automation): third revision of the webhook delivery design (#911)
docs(cron): design note for the outbound signed webhook delivery target
feat(core): add vetted_post and a per-call address policy for outboun…
feat(core): add vetted_post and a per-call address policy for outboun…
feat(cli): add [webhook_out] destinations and the webhook:<name> cron…
feat(cli): add pure event ids and payload builders for outbound webho…
feat(cli): add the outbound webhook outbox format and its fold (#925)
feat(cli): add outbound webhook request signing and the pinned test v…
feat(cli): add the outbound webhook outbox store (#926)
feat(cli): add the outbound webhook sender (#927)
feat(cron): queue webhook deliveries from the tick and send them on a…
feat(cron): queue webhook deliveries from the tick and send them on a…
feat(serve): start the webhook sender thread and report the outbox in…
feat(cron): reconcile the ledger and the webhook outbox after a crash (…
feat(cli): add tole webhook test to check a destination end to end (#931
feat(serve): add a notifier hook to the approval queue and redact app…
feat(cli): add the volatile queue and notifier for approval webhook e…
feat(serve): send approval webhook events from a sender thread with a…
test(webhook): real-binary serve e2e for cron and approval events; ho…
fix(webhook): hold URL tokens as secrets and test the approval path e…
test(webhook): real-binary serve e2e for cron delivery with failure i…
docs(webhook): record the outbound webhook work in the threat model, …
docs(webhook_out): design note for a turn_finished outbound event (#976)