Skip to content

Isolated cron jobs fail: Cannot read properties of undefined (reading 'sourceReplyDeliveryMode') #85051

Closed

Description

@mwarf

Bug Report

All sessionTarget: "isolated" cron jobs fail immediately with:

TypeError: Cannot read properties of undefined (reading 'sourceReplyDeliveryMode')

First appeared: 2026.5.18 (May 18, 2026)
Still present: 2026.5.19
Last working: 2026.5.12

Details

  • Jobs fail in ~90-250ms — the agent never starts
  • The error occurs in the isolated agent runner initialization, before any agent turn begins
  • Affects ALL isolated cron jobs regardless of:
    • delivery mode (none or announce)
    • sessionKey presence
    • wakeMode (now or next-heartbeat)
  • Jobs with sessionTarget: "main" (systemEvent payload) are unaffected

Working vs Broken Comparison

Job sessionTarget Delivery Status
Monday Pipeline isolated announce ✅ Last ran successfully May 18 8 AM (before update)
Friday Review isolated none ✅ Last ran successfully May 16 3 PM
Morning Briefing isolated none → announce ❌ Failing since May 18
Lead Response Monitor isolated none → announce ❌ Failing since May 18
Daily Content Scrape isolated none → announce ❌ Failing since May 18
Daily Note Generator isolated announce ❌ Never ran (created after regression)
Jesse Sadlowski Prep main (systemEvent) n/a ✅ Not yet due

Reproduction

  1. Create any cron job with sessionTarget: "isolated" and payload.kind: "agentTurn"
  2. Trigger it (scheduled or manual cron run)
  3. Observe immediate failure with sourceReplyDeliveryMode error

Environment

  • macOS 15.x (Apple Silicon)
  • Node v25.9.0
  • OpenClaw 2026.5.19 (installed via npm)
  • Model: zai/glm-5
  • Channel: Telegram

Run History (example job)

Last successful run: 2026-05-17 08:00 MDT — completed in 17s, glm-5, normal usage
First failed run: 2026-05-18 08:00 MDT — failed in 148ms with the undefined error
All subsequent runs: same error, same ~100-250ms duration

Activity

  1. clawsweeper commented on May 21, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 19, 2026, 9:21 PM ET / 01:21 UTC.

    Summary
    Keep open: current main and the latest release still contain the unguarded isolated-cron sourceDelivery dereference, and the linked closing PR at #85249 is open rather than merged.

    Reproducibility: Partially. Source inspection shows the executor still dereferences params.sourceDelivery.sourceReplyDeliveryMode, matching an omitted-sourceDelivery crash, but this review did not run a live packaged cron job against current main.

    Root-cause cluster
    Relationship: canonical
    Canonical: #85051
    Summary: This issue is the active canonical report for the isolated cron sourceReplyDeliveryMode crash, with an open linked PR as the candidate fix and closed duplicates carrying the same symptom.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Next step
    No new repair lane should start while an open closing PR already targets this crash.

    Review details

    Best possible solution:

    Review and land or replace #85249, then close this issue after the fix reaches main.

    Do we have a high-confidence way to reproduce the issue?

    Partially. Source inspection shows the executor still dereferences params.sourceDelivery.sourceReplyDeliveryMode, matching an omitted-sourceDelivery crash, but this review did not run a live packaged cron job against current main.

    Is this the best way to solve the issue?

    Yes for triage. Keeping this issue open while maintainers review the linked fix PR is the narrowest path; a new automated fix PR would duplicate the existing candidate.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The exact live packaged cron failure was not reproduced in this read-only review, although current source and the linked PR proof match the reported omitted-sourceDelivery crash shape.
    • The linked PR intentionally adds a version-skew runtime fallback with message-delivery reconstruction semantics, so maintainers still need to accept that compatibility contract before merge.

    Codex review notes: model internal, reasoning high; reviewed against 50b5238b3895.

    Label changes

    Label justifications:

    • P1: The issue reports a regression that prevents isolated scheduled agent jobs from starting.
    • impact:crash-loop: Affected cron jobs repeatedly fail immediately during isolated runner initialization.
    Evidence reviewed

    What I checked:

    Likely related people:

    • steipete: GitHub commit metadata maps the cron source-delivery centralization commit to steipete, and that commit made sourceDelivery the executor boundary field named by the crash. (role: introduced source-delivery refactor; confidence: high; commits: 4c613fbfe05f; files: src/cron/isolated-agent/run.ts, src/cron/isolated-agent/run-executor.ts, src/cron/isolated-agent/run.message-tool-policy.test.ts)
    • obviyus: Earlier merged cron delivery/message-tool commits by obviyus define semantics that the linked guard needs to preserve. (role: adjacent cron delivery contributor; confidence: medium; commits: 49ae60d6cae1, 13a0d7a9e035; files: src/cron/isolated-agent/run.ts, src/cron/isolated-agent/run.message-tool-policy.test.ts)
    • Jerry-Xin: Jerry-Xin authored the open closing PR that directly targets the missing-sourceDelivery isolated cron crash and adds fallback tests. (role: linked fix PR author; confidence: high; commits: 4aa60ff3e934; files: src/cron/isolated-agent/source-delivery-fallback.ts, src/cron/isolated-agent/run.source-delivery-guard.test.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:crash-loopCrash, hang, restart loop, or process-level availability failure.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on May 21, 2026
  3. added
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    and removed
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    on Jun 15, 2026
  4. ai-freer commented on Jun 25, 2026

    @ai-freer

    Adding a clean-deployment data point in case it helps narrow the repro shape.

    Environment

    • OpenClaw 2026.6.10 (commit aa69b12), installed via npm install -g openclaw@2026.6.10
    • No partial build / no module cache reuse — dist was freshly extracted from the npm tarball
    • Local workspace runs 22 patches via apply-patches.sh on ExecStartPre; none touch the run.ts ↔ run-executor.ts lazy-import boundary or the SourceDeliveryPlan shape

    Observation

    20 active cron jobs, all payload.kind: "agentTurn" (sessionTarget mix of isolated and session:...), running for ~24h since upgrade:

    • 19/20 lastRunStatus: "ok" — including representative agentTurn crons like wiki-daily-compile, todo-health-morning/evening, warm-compress-daily-dryrun, self-improving-daily-reflection, weekly-signal-digest, memory-health-check-weekly, storage-patrol-weekly, weekly-cross-system-digest
    • 1/20 error (monthly-retro) — unrelated, a model-routing context blowup (claude-opus-4-7 pulled ~2M input tokens); no sourceReplyDeliveryMode TypeError

    Reading

    This is consistent with the PR #85249 problem statement: the unguarded params.sourceDelivery.sourceReplyDeliveryMode dereference is still in current main / v2026.6.10 (src/cron/isolated-agent/run-executor.ts), but a clean npm install + clean dist does not trigger it in the normal isolated cron path because run.ts passes prepared.context.sourceDelivery into the executor.

    The bug is present-but-conditional: it needs a path that bypasses the run.ts planner (partial build, stale compiled JS, ESM module cache holding old executor shape, or out-of-tree callers).

    Not claiming this is harmless — the unguarded dereference is still worth fixing, and #85249's fallback planner is the right shape. Just adding evidence that clean 2026.6.x deployments aren't reproducing the crash, which may explain the lack of new reports.

  5. locked as resolved and limited conversation to collaborators on Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions