-
-
Notifications
You must be signed in to change notification settings - Fork 69.1k
bug: sessionTarget "main" silently skips for non-main agent crons #30097
Description
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
- Configure an agent in
openclaw.json(e.g.,"agentId": "glean") - Create a cron job targeting that agent:
{
"name": "Glean Outreach W1",
"sessionTarget": "main",
"payload": {
"kind": "systemEvent",
"text": "Run your next scheduled task."
}
}- Wait for the cron to fire
- Check run history — status shows "disabled", duration ~0ms
Expected Behavior
Either:
- The
systemEventshould 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