Skip to content

bug: sessionTarget "main" silently skips for non-main agent crons #30097

@shariqriazz

Description

@shariqriazz

Summary

Cron jobs configured with sessionTarget: "main" and payload.kind: "systemEvent" for agents other than the main agent silently return "disabled" and never execute. There is no error, no warning, and no log entry explaining why the job was skipped.

Steps to Reproduce

  1. Configure an agent in openclaw.json (e.g., "agentId": "glean")
  2. Create a cron job targeting that agent:
{
  "name": "Glean Outreach W1",
  "sessionTarget": "main",
  "payload": {
    "kind": "systemEvent",
    "text": "Run your next scheduled task."
  }
}
  1. Wait for the cron to fire
  2. Check run history — status shows "disabled", duration ~0ms

Expected Behavior

Either:

  • The systemEvent should be delivered to the agent's main session, OR
  • The cron system should reject the configuration at creation time with a clear error: "sessionTarget main is only valid for the main agent. Use sessionTarget isolated with agentTurn for other agents."

Actual Behavior

The job is created successfully, appears valid in the job list, but silently skips every execution with status "disabled". No error is surfaced anywhere.

Impact

Medium-high — we had 26 cron jobs configured this way for 8 agents. All appeared to be set up correctly but none were executing. Debugging took several hours before discovering the pattern. The fix was rebuilding all 26 jobs as sessionTarget: "isolated" with payload.kind: "agentTurn".

Suggested Fix

Validation at job creation time: if sessionTarget: "main" is used with any agent other than the main agent, return an error explaining the constraint and suggesting the isolated + agentTurn pattern instead.

Environment

  • OpenClaw latest (as of Feb 28, 2026)
  • Oracle Cloud ARM64, Linux 6.17
  • 10 agents configured, 26 cron jobs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions