Repository navigation
fix(cron): reject failure-destination announce delivery with no recipient basis - #181
Conversation
…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 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.
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
There was a problem hiding this comment.
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 stalesessionKeysurvives a patch — the JSDoc explaining that choice is exactly right. - Widening
resolveFailureDestinationtoPick<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.
…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.
#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.
What Problem This Solves
A cron job can be created (or updated) with an explicit
delivery.failureDestinationannounce override that has no way to ever resolve a recipient — no explicitto, and the job has no session of its own (sessionTarget="isolated"with nosessionKey). 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.updatetime instead of silently accepting it. The check is intentionally scoped to an explicit per-jobdelivery.failureDestinationoverride only (not a defaulted primarydelivery.mode="announce", which legitimately resolves live at run time via session/channel-selection context, and not an inherited globalcron.failureDestinationdefault) — 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 (explicitto, or a session identity viasessionTarget/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.updatecalls that set an explicitdelivery.failureDestinationannounce override with no explicittoand no session of the job's own now fail fast with a clearINVALID_REQUESTerror explaining what to fix, instead of silently succeeding and failing forever at run time.sessionTarget/sessionKey(without touchingdelivery) is also re-validated, since it can retroactively orphan a previously-valid failure destination.cron.failureDestinationdefault.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 asessionTarget-only update that would orphan an existing override, accepts asessionTarget-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.failureDestinationannounce 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 actionableINVALID_REQUEST. The security override also movesfast-urifrom 3.1.5 to 3.1.6 to address four HIGH-severity advisories.Bug Fixes
sessionTargetorsessionKeychanges, preventing updates from orphaning their recipient basis.toor a job-owned session without runtime session or plugin I/O.cron.failureDestinationdefaults and defaulted primary announce delivery unchanged.Dependencies
fast-uri3.1.6, which fixes host-confusion and SSRF issues.Written for commit 52ceb5f. Summary will update on new commits.