Skip to content

cron: separate webhook POST delivery from announce#17901

Merged
tyler6204 merged 4 commits intoopenclaw:mainfrom
advaitpaliwal:fix/cron-delivery-webhook-mode
Feb 16, 2026
Merged

cron: separate webhook POST delivery from announce#17901
tyler6204 merged 4 commits intoopenclaw:mainfrom
advaitpaliwal:fix/cron-delivery-webhook-mode

Conversation

@advaitpaliwal
Copy link
Contributor

@advaitpaliwal advaitpaliwal commented Feb 16, 2026

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: cron used notify: true + global cron.webhook for webhook POSTs, while delivery.mode="announce" handled channel delivery; this split caused confusion and duplicated concepts.
  • Why it matters: webhook POST and channel announce are different transport paths, and users need per-job webhook URLs.
  • What changed: added delivery.mode="webhook" (with delivery.to as URL), removed notify from cron job schema/types/UI/tool docs, and kept a legacy fallback for old notify jobs via cron.webhook.
  • What did NOT change (scope boundary): channel announce behavior (delivery.mode="announce") and isolated-run delivery mechanics remain unchanged.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

  • Cron jobs now support delivery.mode: "webhook" + delivery.to: "https://..." for finished-run webhook POST delivery.
  • delivery.mode: "announce" remains channel delivery only.
  • Cron job notify is removed from add/update/list contracts and Control UI form.
  • cron.webhook is now documented/used as a legacy fallback only for older jobs that still contain notify: true.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (Yes)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:
    • Risk: user-provided webhook URL can fail/timeout.
    • Mitigation: existing 10s timeout + error logging remains; cron.webhookToken can be used for auth.

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: Node 22 + pnpm
  • Model/provider: N/A
  • Integration/channel (if any): Gateway cron + Control UI
  • Relevant config (redacted): optional cron.webhookToken

Steps

  1. Create cron job with delivery.mode="webhook" and delivery.to URL.
  2. Force-run the job.
  3. Confirm webhook POST payload is emitted only for webhook-mode jobs with summary.

Expected

  • Webhook jobs POST finished event payload to delivery.to.
  • Non-webhook jobs do not POST.
  • Announce mode remains channel delivery behavior.

Actual

  • Matches expected.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios:
    • webhook-mode finished POST for main and isolated cron jobs.
    • announce-mode and none-mode behavior unchanged in delivery planner/UI rendering.
    • protocol/UI/Swift delivery mode conformance includes webhook.
  • Edge cases checked:
    • no-summary run does not POST.
    • legacy notify fallback still posts via cron.webhook when present in stored jobs.
  • What you did not verify:
    • full end-to-end manual webhook receiver outside test mocks.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly:
    • set cron job delivery to none or remove webhook delivery fields.
    • rollback to previous commit.
  • Files/config to restore:
    • src/cron/*, src/gateway/server-cron.ts, src/gateway/protocol/schema/cron.ts, ui/src/ui/*.
  • Known bad symptoms reviewers should watch for:
    • missing webhook POSTs when delivery.mode="webhook" is set.

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk: existing automation may still set notify in add/update payloads.
    • Mitigation: legacy store fallback remains for persisted jobs; docs/UI/tool schema now steer to delivery webhook mode.

Greptile Summary

Separates webhook POST delivery from channel announce delivery by adding delivery.mode="webhook" with delivery.to URL support, removing the deprecated notify field from the cron job schema, and maintaining backward compatibility for legacy jobs via cron.webhook fallback.

Key changes:

  • Added "webhook" as a new CronDeliveryMode alongside "announce" and "none"
  • Webhook mode now explicitly requires delivery.to URL instead of relying on global cron.webhook + notify flag
  • Removed notify field from protocol schema, UI forms, tool documentation, and type definitions
  • Legacy fallback preserved: stored jobs with notify: true continue to POST via cron.webhook config
  • Updated assertDeliverySupport to allow webhook mode for both main and isolated session targets, while restricting announce mode to isolated only
  • Channel routing (delivery.channel) correctly excluded for webhook mode
  • Documentation and UI updated to reflect webhook as a delivery mode rather than a separate notification mechanism

Confidence Score: 4/5

  • Safe to merge with minor attention to edge case handling
  • The refactor is well-structured with comprehensive test coverage, proper backward compatibility via legacy fallback, and clean separation of concerns. The score of 4 (not 5) reflects one edge case: webhook mode with missing URL returns null but doesn't fail fast at job creation time, which could lead to silent failures at runtime.
  • Review src/gateway/server-cron.ts:41-42 for webhook URL validation - consider adding validation at job creation time rather than silently returning null at runtime

Last reviewed commit: 9c549c6

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

25 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 41 to 42
const url = params.delivery?.to?.trim();
return url ? url : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webhook mode with empty/missing URL returns null silently at runtime rather than failing at job creation

This allows invalid webhook jobs to be created but fail silently when they run. Consider adding validation in src/cron/service/jobs.ts createJob or applyJobPatch to reject delivery.mode="webhook" when delivery.to is missing/empty.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/gateway/server-cron.ts
Line: 41:42

Comment:
webhook mode with empty/missing URL returns `null` silently at runtime rather than failing at job creation

This allows invalid webhook jobs to be created but fail silently when they run. Consider adding validation in `src/cron/service/jobs.ts` `createJob` or `applyJobPatch` to reject `delivery.mode="webhook"` when `delivery.to` is missing/empty.

How can I resolve this? If you propose a fix, please make it concise.

@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: M labels Feb 16, 2026
@tyler6204 tyler6204 self-assigned this Feb 16, 2026
@tyler6204 tyler6204 merged commit bc67af6 into openclaw:main Feb 16, 2026
24 of 25 checks passed
@tyler6204
Copy link
Member

Merged via squash.

Thanks @advaitpaliwal!

Archeb pushed a commit to Archeb/openclaw that referenced this pull request Feb 16, 2026
* cron: split webhook delivery from announce mode

* cron: validate webhook delivery target

* cron: remove legacy webhook fallback config

* fix: finalize cron webhook delivery prep (openclaw#17901) (thanks @advaitpaliwal)

---------

Co-authored-by: Tyler Yust <[email protected]>
thinstripe pushed a commit to thinstripe/openclaw that referenced this pull request Feb 16, 2026
* cron: split webhook delivery from announce mode

* cron: validate webhook delivery target

* cron: remove legacy webhook fallback config

* fix: finalize cron webhook delivery prep (openclaw#17901) (thanks @advaitpaliwal)

---------

Co-authored-by: Tyler Yust <[email protected]>
treygoff24 pushed a commit to treygoff24/openclaw that referenced this pull request Feb 16, 2026
* cron: split webhook delivery from announce mode

* cron: validate webhook delivery target

* cron: remove legacy webhook fallback config

* fix: finalize cron webhook delivery prep (openclaw#17901) (thanks @advaitpaliwal)

---------

Co-authored-by: Tyler Yust <[email protected]>
archerhpagent pushed a commit to howardpark/openclaw that referenced this pull request Feb 18, 2026
* cron: split webhook delivery from announce mode

* cron: validate webhook delivery target

* cron: remove legacy webhook fallback config

* fix: finalize cron webhook delivery prep (openclaw#17901) (thanks @advaitpaliwal)

---------

Co-authored-by: Tyler Yust <[email protected]>
jun-planfit pushed a commit to planfit/openclaw that referenced this pull request Feb 19, 2026
* cron: split webhook delivery from announce mode

* cron: validate webhook delivery target

* cron: remove legacy webhook fallback config

* fix: finalize cron webhook delivery prep (openclaw#17901) (thanks @advaitpaliwal)

---------

Co-authored-by: Tyler Yust <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: macos App: macos app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments