openclaw - 💡(How to fix) Fix cron list: add --agent filter for multi-agent isolation [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56778Fetched 2026-04-08 01:47:52
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Fix Action

Fix / Workaround

  1. Confusing UX — the agent reports tasks that don't belong to it
  2. No native filteringopenclaw cron list has no --agent <id> option
  3. Workaround required — must add soft instructions in SOUL.md telling each agent to manually filter by agentId, which is unreliable (LLM may not always follow)

Code Example

$ openclaw cron list
ID       Name                        Agent ID
...      BSC Meme Token 每日分析       -        (belongs to main)
...      地缘政治×币圈分析               -        (belongs to main)
...      每日自我迭代(技能检查+更新)       anzi
...      医美情报采集(7:00)              anzi
...      医美情报推送(9:30)              anzi
RAW_BUFFERClick to expand / collapse

Problem

In a multi-agent setup, openclaw cron list returns all cron jobs globally, regardless of which agent is requesting. This breaks the isolation principle that other subsystems (sessions, workspace, memory) already enforce at the agent level.

Current behavior

When agent anzi (medical aesthetics) queries its cron tasks, it sees tasks belonging to agent main (crypto/trading) as well. This causes:

  1. Confusing UX — the agent reports tasks that don't belong to it
  2. No native filteringopenclaw cron list has no --agent <id> option
  3. Workaround required — must add soft instructions in SOUL.md telling each agent to manually filter by agentId, which is unreliable (LLM may not always follow)

Example

$ openclaw cron list
ID       Name                        Agent ID
...      BSC Meme Token 每日分析       -        (belongs to main)
...      地缘政治×币圈分析               -        (belongs to main)
...      每日自我迭代(技能检查+更新)       anzi
...      医美情报采集(7:00)              anzi
...      医美情报推送(9:30)              anzi

When anzi's session calls cron list, it gets all 5 jobs and presents them to the user as if they're all its own.

Expected behavior

  1. openclaw cron list --agent <id> should filter jobs by agentId
  2. Ideally, when an agent session queries cron list via the gateway, it should auto-scope to the requesting agent's jobs only (similar to how sessions are scoped)
  3. Jobs with no explicit agentId should only be visible to the default agent

Environment

  • OpenClaw version: 2026.3.28 (f9b1079)
  • Setup: 2 agents (main + anzi), each with separate workspace, sessions, and WeChat channel bindings
  • All other subsystems (sessions, workspace, memory) are properly isolated per agent

extent analysis

Fix Plan

To fix the issue, we need to modify the openclaw cron list command to filter cron jobs by agent ID. Here are the steps:

  • Add a new option --agent <id> to the openclaw cron list command
  • Modify the cron job retrieval logic to filter jobs by agent ID when the --agent option is provided
  • Implement auto-scoping for agent sessions to retrieve only the requesting agent's jobs

Example Code

# Add a new option --agent to the cron list command
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--agent', help='Filter cron jobs by agent ID')

# Modify the cron job retrieval logic
def get_cron_jobs(agent_id=None):
    if agent_id:
        # Filter cron jobs by agent ID
        return [job for job in cron_jobs if job['agentId'] == agent_id]
    else:
        # Return all cron jobs
        return cron_jobs

# Implement auto-scoping for agent sessions
def get_cron_jobs_for_agent_session(agent_id):
    # Retrieve only the requesting agent's jobs
    return get_cron_jobs(agent_id)

# Usage example
args = parser.parse_args()
if args.agent:
    cron_jobs = get_cron_jobs(args.agent)
else:
    # Auto-scope to the requesting agent's jobs
    cron_jobs = get_cron_jobs_for_agent_session(requesting_agent_id)

Verification

To verify the fix, run the following commands:

  • openclaw cron list --agent anzi should only return cron jobs belonging to the anzi agent
  • openclaw cron list without the --agent option should return all cron jobs
  • Agent sessions should only retrieve the requesting agent's jobs when querying the cron list via the gateway

Extra Tips

  • Make sure to update the documentation for the openclaw cron list command to reflect the new --agent option
  • Consider adding a default agent ID for jobs without an explicit agentId to ensure they are only visible to the default agent.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  1. openclaw cron list --agent <id> should filter jobs by agentId
  2. Ideally, when an agent session queries cron list via the gateway, it should auto-scope to the requesting agent's jobs only (similar to how sessions are scoped)
  3. Jobs with no explicit agentId should only be visible to the default agent

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix cron list: add --agent filter for multi-agent isolation [1 participants]