Skip to content

fix(cron): reject failure-destination announce delivery with no recipient basis - #181

Merged
william-antoline-boon merged 3 commits into
boonfrom
william-antoline-boon/eng-19128-cron-failure-destination-recipient-check
Sep 3, 2026
Merged

william-antoline-boon merged 3 commits into
boonfrom
william-antoline-boon/eng-19128-cron-failure-destination-recipient-check

Conversation

@william-antoline-boon

@william-antoline-boon william-antoline-boon commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

A cron job can be created (or updated) with an explicit delivery.failureDestination announce override that has no way to ever resolve a recipient — no explicit to, and the job has no session of its own (sessionTarget="isolated" with no sessionKey). That job is accepted today, then fails to deliver its own failure notification on every single run, forever, with no error ever surfacing to an operator. This mirrors a real production incident: a standing cron job accumulated a long streak of run failures against a deleted resource, and its own failure-alert delivery was also unresolvable, so the whole failure was invisible until a human happened to notice.

Why This Change Was Made

Reject that shape at cron.add/cron.update time instead of silently accepting it. The check is intentionally scoped to an explicit per-job delivery.failureDestination override only (not a defaulted primary delivery.mode="announce", which legitimately resolves live at run time via session/channel-selection context, and not an inherited global cron.failureDestination default) — this is the narrowest, lowest-risk slice of the problem: a job author's own explicit claim about where failures should go, which is exactly the case that produced a silent two-layer failure in production.

An earlier version of this check reused the full runtime delivery resolver (the same dry-run resolver used by cron.list's delivery preview and by actual run-time dispatch) but that does real session-store/plugin-runtime I/O and was too expensive/fragile for a synchronous validation gate — it hung a test to its timeout. The final implementation is a cheap, purely structural, dependency-free check instead: it proves a recipient basis exists (explicit to, or a session identity via sessionTarget/sessionKey), not that the target is currently live — verifying full liveness (e.g. a stale/deleted session) would require the same expensive resolver this avoids.

User Impact

  • cron.add/cron.update calls that set an explicit delivery.failureDestination announce override with no explicit to and no session of the job's own now fail fast with a clear INVALID_REQUEST error explaining what to fix, instead of silently succeeding and failing forever at run time.
  • An update that changes only sessionTarget/sessionKey (without touching delivery) is also re-validated, since it can retroactively orphan a previously-valid failure destination.
  • No change to jobs that don't set an explicit failure-destination override, or that inherit the global cron.failureDestination default.

Evidence

  • src/gateway/server-methods/cron.validation.test.ts — 6 new test cases: rejects on an isolated job, accepts when the job carries its own session, does not reject an inherited global default, rejects on update, rejects a sessionTarget-only update that would orphan an existing override, accepts a sessionTarget-only update that doesn't affect resolvability.
  • pnpm test src/gateway/server-methods/cron.validation.test.ts src/cron/delivery-plan.test.ts — 100/100 passing.
  • pnpm test src/cron — 111 files / 1174 tests passing (no regressions).
  • tsgo:core — clean (fresh cache).
  • oxlint / oxfmt --check — clean.

Summary by cubic

Addresses ENG-19128 by rejecting cron jobs with an explicit delivery.failureDestination announce override that has no recipient basis. These jobs previously succeeded and then failed to deliver their own failure alerts; they now fail fast with an actionable INVALID_REQUEST. The security override also moves fast-uri from 3.1.5 to 3.1.6 to address four HIGH-severity advisories.

Bug Fixes

  • Revalidates existing overrides when sessionTarget or sessionKey changes, preventing updates from orphaning their recipient basis.
  • Uses a structural check for an explicit to or a job-owned session without runtime session or plugin I/O.
  • Leaves inherited global cron.failureDestination defaults and defaulted primary announce delivery unchanged.

Dependencies

  • Regenerates the repository lockfiles and extension shrinkwraps for fast-uri 3.1.6, which fixes host-confusion and SSRF issues.

Written for commit 52ceb5f. Summary will update on new commits.

Review in cubic

…ient basis

An isolated cron job's own failureDestination override can be configured
with no explicit target and no session to fall back on, so its failure
alert fails to deliver on every run with the failure never surfacing to
an operator. Reject that shape at cron.add/cron.update time instead.
@claude

claude Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

…/eng-19128-cron-failure-destination-recipient-check
fast-uri <3.1.6 has 4 HIGH-severity advisories (host confusion and SSRF via
scheme/IDN/percent-decoding normalization bugs). It's pulled in transitively
via ajv and was pinned to the vulnerable 3.1.5 in the existing security
override list. Bump to 3.1.6, the oldest fixed release past the repo's
minimum-release-age window, and regenerate the affected shrinkwraps.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/acpx/npm-shrinkwrap.json
  • extensions/lobster/npm-shrinkwrap.json
  • npm-shrinkwrap.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: 52ceb5ffbc1e3b2f7487ac48e441a745177aec1a
  • Trusted actor: @william-antoline-boon
  • Trusted role: pull request author; repository admin

Security review is still recommended before merge when the dependency graph change is intentional.

@gandalfboon gandalfboon Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tight fix. The scoping is right — reject only the explicit per-job failureDestination override without recipient basis, not inherited globals or defaulted primary announce delivery. Structural check (no resolver I/O) is the correct call after the earlier resolver-based attempt hung tests.

Nice catches:

  • Re-running the recipient-basis check on sessionTarget/sessionKey-only patches so an update can't silently orphan a previously-valid override.
  • Treating sessionTarget="isolated" as no basis even if a stale sessionKey survives a patch — the JSDoc explaining that choice is exactly right.
  • Widening resolveFailureDestination to Pick<CronJob, "delivery"> narrows the input contract.

Test coverage hits create + update + orphaning update + inherited-default no-op. fast-uri 3.1.6 bump closes 4 HIGH advisories; shrinkwraps + pnpm-workspace overrides all in sync. CI green across the board.

@william-antoline-boon
william-antoline-boon merged commit 83adadc into boon Sep 3, 2026
147 of 148 checks passed
@william-antoline-boon
william-antoline-boon deleted the william-antoline-boon/eng-19128-cron-failure-destination-recipient-check branch September 3, 2026 03:47
convyusboy added a commit that referenced this pull request Sep 3, 2026
…nflicts)

5 feature/fix commits (boon.32, boon.33): confirm-before-act on ambiguous
requests (#175), unclosed content-block detection at stream finalization
(ENG-19233, #177), >384MB PDF handling (#178), macro-enabled Office document
delivery (#179), cron failure-destination recipient validation (#181).

All conflicts were the established package.json/npm-shrinkwrap.json
version-string pattern (kept 2026.6.34-boon.1), plus a new one this round:
origin/boon still pins fast-uri at 3.1.6 across pnpm-workspace.yaml,
pnpm-lock.yaml, and four npm-shrinkwrap.json files (root, acpx, lobster).
This integration branch already carries a deliberate 4.1.2 override from the
original 2026.6.34 sync (documented in the PR description's "Dependency /
security pins" section: the bump was needed because upstream's 6.34-era code
targets fast-uri's 4.x API, not because it's numerically newer) -- the same
"boon hasn't caught up to a pin this branch already needed" situation as the
`tar` override in that same section. Kept 4.1.2 everywhere.

Verified: pnpm tsgo:core:test + tsgo:extensions:test both clean. Targeted
tests across every touched surface (pdf-tool, web-media, mime, cron
delivery-target-validation + cron.validation, anthropic-transport-stream,
concise-interaction-overlay, embedded-agent-helpers, amazon-bedrock stream
runtime, anthropic prompt-overlay, document-extract) -- 303 passing, 0
failures. One unrelated pre-existing failure noted and left alone:
src/gateway/mcp-http.test.ts's "withdraws a closing runtime before drain
without fencing its successor" fails deterministically in this sandboxed
environment with a raw ECONNRESET on a real loopback TCP socket -- neither
mcp-http.ts nor its test file were touched by this merge, so this is an
environment/network-sandboxing artifact, not a regression from this change.
insomnius added a commit that referenced this pull request Sep 3, 2026
#186 bumped the version but omitted the CHANGELOG.md section, so the
boon-release.yml prepack (scripts/package-changelog.mjs) hard-fails with
"CHANGELOG.md does not contain a release section for 2026.6.11-boon.34"
and no fleet tarball is built. Add the boon.34 section (covers #185
ENG-19115 OBO ctx fix, #182, #181) to unblock the release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant