Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.
Description
Problem
Currently, all cron jobs are stored centrally in ~/.openclaw/cron/jobs.json at the Gateway layer, detached from Agent configuration. While jobs can be bound to an agent via agentId, the task ownership and configuration are separated, causing:
- Configuration fragmentation: Agent settings (workspace, model, tools) are in
openclaw.json, but their scheduled tasks are in a separate file - Ownership ambiguity: In multi-agent setups, it's unclear which Agent "owns" which tasks
- Management overhead: Tasks must be managed via CLI (
openclaw cron add/edit) rather than declarative config
Current Architecture
Gateway Layer
├── cron/jobs.json ← All tasks here
│ └── job.agentId: "main" ← Can bind to Agent
└── openclaw.json
└── agents.list[] ← No cron field
Agent Layer
├── workspace/AGENTS.md
├── workspace/SOUL.md
└── ❌ No native scheduled task definition
Proposed Solution
Add a cron field to agents.list[] configuration:
{
agents: {
list: [{
id: "main",
workspace: "~/.openclaw/workspace",
model: "anthropic/claude-opus-4-6",
// NEW: Agent-owned scheduled tasks
cron: [{
id: "daily-news",
schedule: "0 13 * * *",
tz: "Asia/Shanghai",
message: "Execute news briefing",
enabled: true
}, {
id: "health-check",
schedule: "*/30 * * * *",
message: "Check system health",
sessionTarget: "isolated",
delivery: { mode: "none" }
}]
}]
}
}Behavior
- On Gateway startup: Scan all
agents.list[].cronand load into scheduler - Task ID namespacing: Internally prefix with
agent:<id>:<cronId>to avoid collisions - Inheritance: Tasks inherit Agent's workspace, model, and tool settings
- Backward compatibility: Existing
cron/jobs.jsoncontinues to work; Agent-defined tasks are merged - Precedence: If same task ID exists in both locations, CLI-defined (jobs.json) takes precedence
Benefits
- Colocation: Agent config and its scheduled tasks are together
- Declarative: Can version-control Agent + tasks as a unit
- Portability: Copy Agent workspace + config = copy all related scheduled tasks
- Multi-tenant clarity: Each Agent's tasks are clearly defined in its config
Alternative Considered
Continue using agentId binding on CLI-managed jobs. This works but keeps configuration fragmented. The proposed solution follows the principle of "Agent autonomy" - an Agent's behavior should be fully defined in its configuration.
Related
- Current cron implementation:
docs/automation/cron-jobs.md - Multi-agent routing:
docs/concepts/multi-agent.md
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.
Type
Fields
Priority
None yet
Activity
openclaw-barnacle commentedon Apr 29, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
clawsweeper commentedon Apr 29, 2026
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
Close as superseded by the newer durable routines design item: current main still lacks the literal
agents.list[].cronfield, but the remaining scheduling-product question is now tracked by the maintainer-labeled routine registry issue, which explicitly treats direct agent-config routines as an overlapping but weaker shape.Root-cause cluster
Relationship:
supersededCanonical: #98515
Summary: The newer durable routines issue is the canonical tracker for the recurring scheduled-operations product direction; this issue's direct agent-config cron shape is an overlapping alternative that the canonical issue explicitly calls harder for mutation and status visibility.
Members:
canonical: [Feature]: Durable routines registry for scheduled team operations #98515 - It is the maintainer-labeled design item for durable schedule-backed routines and explicitly discusses direct agent config routines as an overlapping alternative.fixed_by_candidate: feat: add durable routines registry #98727 - It is the open draft candidate implementation for the canonical durable routines issue, not yet a merged fix.partial_overlap: [Feature]: Isolated cron scheduled jobs per agent (per-agent jobs.json) in multi-user deployments #26370 - It covered per-agent cron isolation and security ownership, which constrains this request but did not own declarative agent config.partial_overlap: Scope agent cron operations to the calling agent #96883 - It merged caller-scoped agent cron operations, addressing ownership enforcement without addingagents.list[].cron.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Canonical path: Use #98515 as the canonical design path for recurring scheduled operations, with schedule-backed routines compiling to the existing SQLite-backed cron scheduler; revisit declarative seed config only after routine ownership, reconciliation, and mutation semantics are decided.
So I’m closing this here and keeping the remaining discussion on #98515.
Review details
Best possible solution:
Use #98515 as the canonical design path for recurring scheduled operations, with schedule-backed routines compiling to the existing SQLite-backed cron scheduler; revisit declarative seed config only after routine ownership, reconciliation, and mutation semantics are decided.
Do we have a high-confidence way to reproduce the issue?
Not applicable as a bug reproduction: this requests a new public config field. Source inspection confirms current main does not define or load
agents.list[].cron.Is this the best way to solve the issue?
No for the literal proposed shape as the current best path: the newer durable routines design preserves one scheduler source and gives mutable status visibility. If declarative config is still desired later, it should be designed as a reconciliation or seed layer over routines/cron, not as a second runtime source of truth.
Security review:
Security review: No patch is under review, and this ordinary feature request does not itself report a security vulnerability.
AGENTS.md: found and applied where relevant.
What I checked:
AgentConfigincludes per-agent workspace, model, skills, heartbeat, sandbox, tools, and runtime fields, but no cron or scheduled-task field. (src/config/types.agents.ts:81, 1d839d33397d)AgentEntrySchemaenumerates acceptedagents.list[]keys withoutcronand ends with.strict(), so the requested config shape is not accepted by current main. (src/config/zod-schema.agent-runtime.ts:1033, 1d839d33397d)buildGatewayCronServiceresolvescfg.cron?.storeandcfg.cron?.enabledbefore constructingCronService; it uses agent IDs for execution routing, not declarativeagents.list[].cronloading. (src/gateway/server-cron.ts:190, 1d839d33397d)openclaw cronor Gateway cron RPCs rather than editing legacyjobs.json. Public docs:docs/automation/cron-jobs.md. (docs/automation/cron-jobs.md:42, 1d839d33397d)Likely related people:
src/cron/store.ts,docs/automation/cron-jobs.md,src/gateway/server-cron.ts)src/gateway/server-methods/cron.ts,src/agents/tools/cron-tool.ts,packages/gateway-protocol/src/cron-validators.test.ts)src/cron/run-log.ts,src/cron/service/ops.ts,src/gateway/server-methods/cron.ts)Codex review notes: model internal, reasoning high; reviewed against 1d839d33397d.
openclaw-barnacle commentedon Jun 8, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.