Skip to content

Cron isolated agentTurn delivers [object Object] to LLM on 2026.6.1 (regression of #54579) #91412

Closed

Description

@AgentXaGent

Note on prior filing

This was filed yesterday as #91228 with the same content. That issue received correct triage from clawsweeper[bot] (P1, impact:message-loss, platinum hermit rating, needs-live-repro), but was then auto-closed and locked 28 seconds later by openclaw-barnacle[bot] under an r: moltbook label that does not match the issue content. The closed/locked state prevents commenting or reopening from the reporter side. I do not have a Moltbook surface or any Moltbook-related code involved in this report — the regression is a pure cron-isolated-agentTurn payload serialization bug. Refiling here so the bug remains visible to maintainers. Cross-ref to the locked filing: #91228.

Summary

The bug fixed in #54579 has regressed on 2026.6.1. Every cron job with payload.kind: "agentTurn" and sessionTarget: "isolated" receives the literal string [object Object] as the agent prompt instead of the configured payload.message. The scheduler still reports the run as status=ok (the agent didn't crash, it just gave up on garbage input), so this is a silent failure — operators only notice when downstream work stops happening.

I went looking for #54579 after a week of nightly cron silence on a workspace that worked fine on 2026.5.20.

Environment

  • OpenClaw: 2026.6.1 (commit `2e08f0f`, fresh install via `npm i -g openclaw@2026.6.1`)
  • Host: Ubuntu 24.04 (x64), Node v22.22.2
  • Provider: `claude-max` (Anthropic OAuth via local proxy at 127.0.0.1:3456)
  • Previous working version: 2026.5.20 (same workspace, same cron jobs — was fine)

Reproduction (minimal, deterministic)

```jsonc
// via MCP cron add
{
"name": "test-payload-serialization",
"schedule": { "kind": "cron", "expr": "0 4 1 1 *", "tz": "America/New_York" },
"payload": {
"kind": "agentTurn",
"message": "SERIALIZATION_PROBE: reply exactly with the marker token you received and nothing else.",
"model": "claude-haiku-4-5",
"timeoutSeconds": 60
},
"delivery": { "mode": "none" },
"sessionTarget": "isolated"
}
```

Then force-run via `cron run` (MCP) or `openclaw cron run `.

Expected: agent receives `SERIALIZATION_PROBE: reply exactly...` and complies.

Actual: agent's summary (recorded in `~/.openclaw/cron/runs/.jsonl`):

```
Your message came through as `[object Object]` — looks like a serialization glitch on the way in.
What did you mean to send?
```

The persisted payload in `jobs.json` is correct — `payload.message` is a string. `cron get` echoes it back as a string. The corruption happens between scheduler dispatch and the prompt-assembly in the isolated agent session.

Confirmation

Check Result
`jobs.json` has `payload.message` as a string ✓ confirmed
`cron get` returns `payload.message` as a string ✓ confirmed
Run record in `runs/.jsonl` shows agent received `[object Object]` ✓ confirmed
Repros on a brand-new cron added post-upgrade ✓ confirmed (not a stale-state issue)
Repros for both `claude-max/claude-haiku-4-5` and `anthropic/claude-haiku-4-5` ✓ confirmed

Code pointer (dist, since src is not shipped)

The symptom site is the template literal in `dist/isolated-agent-Cw8sZTVo.js:641`:

```js
const base = `[cron:${input.job.id} ${input.job.name}] ${input.message}`.trim();
```

If `input.message` is an object, this produces `[object Object]`.

The upstream call sites all appear to pass `job.payload.message` straight through:

  • `dist/server-cron-CJwAiILI.js:1711` — `message: job.payload.message`
  • `dist/server-cron-CJwAiILI.js:3026-3034` — `runIsolatedAgentJob` → `runCronIsolatedAgentTurn({ ...message })`
  • `dist/isolated-agent-Cw8sZTVo.js:986` — `prepareCronRunContext({ input: params })`

Since the persisted `payload.message` is a string and the final template literal sees an object, the wrap is happening either (a) in the cron run-dispatch layer that constructs the `job` shape from the SQLite-backed store rehydration (cf. #90378's SQLite migration), or (b) in a wrapper added recently around `payload.message` that's not unwrapped at the consumer. I haven't been able to fully isolate this from minified dist alone.

History / Related

Workaround

Migrated the affected job to a system crontab entry invoking the same bash chain directly. Bypasses the agentTurn dispatch entirely. Confirmed working since 2026-06-07.

Activity

  1. clawsweeper commented on Jun 8, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

    Current main already fixes the reported release regression: isolated cron agentTurn prompt assembly now reads the canonical persisted job.payload.message, and regression tests cover both malformed dispatch input and SQLite-rehydrated manual runs. The fix is main-only after v2026.6.1, so the issue should close as implemented on main rather than queue another repair.

    I found the merged PR that appears to have closed this: #91230: fix(cron): preserve isolated agent turn payload message.

    So I’m closing this as already implemented rather than keeping a duplicate issue open.

    Review details

    Best possible solution:

    Keep the current-main fix from #91230 and let the next release carry it; separate cron store migration or delivery-default problems should remain tracked in their own issues.

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

    Yes for the release regression: v2026.6.1 source interpolates input.message into the isolated cron prompt, matching the reported [object Object] symptom when dispatch passes a wrapped object. Current main no longer has that source path.

    Is this the best way to solve the issue?

    Yes: resolving agentTurn prompt text from canonical job.payload.message is the narrow durable fix, and the tests cover both malformed dispatch input and the SQLite-rehydrated manual-run path.

    Security review:

    Security review: This is an issue triage review with no proposed patch and no security-sensitive report.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • Reporter repro: The issue body reports a deterministic v2026.6.1 regression for payload.kind: "agentTurn" with sessionTarget: "isolated", where persisted payload.message remains a string but the isolated agent receives [object Object].
    • Current source fix: Current main resolves isolated agentTurn text from input.job.payload.message before building the cron prompt, so a wrapped or malformed dispatch input.message is no longer interpolated into the LLM prompt. (src/cron/isolated-agent/run.ts:459, 439dcbde3b1f)
    • Regression coverage: The isolated-agent regression test passes a malformed dispatch object and asserts the embedded prompt contains the persisted marker string and not [object Object]. (src/cron/isolated-agent/run.payload-fallbacks.test.ts:42, 439dcbde3b1f)
    • SQLite/manual-run coverage: The service regression test saves an isolated agentTurn cron job, reloads it through the cron store path, force-runs it, and asserts runIsolatedAgentJob receives the original marker message. (src/cron/service/ops.regression.test.ts:267, 439dcbde3b1f)
    • Fix provenance: Blame ties the new resolver and prompt use to commit 4780546, which is the squash commit for fix(cron): preserve isolated agent turn payload message. (src/cron/isolated-agent/run.ts:459, 4780546c124d)
    • Commit provenance: The fix commit message names fix(cron): preserve isolated agent turn payload message #91230 and says the PR changed isolated cron prompt construction to read agentTurn text from job.payload.message with regression coverage for malformed dispatch messages and SQLite-rehydrated manual runs. (4780546c124d)

    Likely related people:

    • Yzx: Authored the current-main fix commit that added resolveCronAgentTurnMessage and the two regression tests for this exact payload-preservation bug. (role: fix author / recent cron contributor; confidence: high; commits: 4780546c124d; files: src/cron/isolated-agent/run.ts, src/cron/isolated-agent/run.payload-fallbacks.test.ts, src/cron/service/ops.regression.test.ts)
    • takhoffman: The fix commit records approval by takhoffman for the merged PR, making them a likely routing point for release or follow-up questions around this fix. (role: reviewer/approver of fix; confidence: medium; commits: 4780546c124d; files: src/cron/isolated-agent/run.ts, src/cron/service/ops.regression.test.ts)
    • Vincent Koc: Local blame shows the pre-fix prompt assembly and surrounding cron service/store baseline came from the grafted commit that introduced these current files in the checkout history. (role: introduced current cron module in local history; confidence: medium; commits: 88c1af0a2cb4; files: src/cron/isolated-agent/run.ts, src/cron/service/timer.ts, src/cron/store/payload-codec.ts)

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 439dcbde3b1f; fix evidence: merged PR #91230, commit 4780546c124d, main fix timestamp 2026-06-08T02:23:02Z.

  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    on Jun 8, 2026
  3. locked as resolved and limited conversation to collaborators on Jun 11, 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.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions