[Bug] Scheduled automations never dispatch — runCount stays 0, cron API works
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Category: Other / 不确定 · Other / Not sure
Agent framework: ZCode Agent(自研)
Severity: 影响体验 · Major (works but degraded)
Reproducibility: 必现 · Always
问题描述 · Description
Scheduled automations are accepted via the Cron tools (create/list/delete all succeed) but the dispatcher never starts any run: at/after the scheduled fire time the automation stays lifecycleStatus=active with runCount=0 and no message is ever delivered. Restarting the app does not help.
复现步骤 · Steps to reproduce
- In any chat, ask the agent to set a one-shot reminder a few minutes ahead (
CronCreatereports success,nextRunAtis set correctly). - Wait past the scheduled fire time (verified up to 40+ minutes later).
- Run
CronList: the automation is stilllifecycleStatus=activewithrunCount=0; no message arrives. - Control test: cron
* * * * *,recurring=false,maxRuns=5, created 16:58:40 local — all 5 fire times passed by 17:03:40 withrunCount=0andnextRunAtnever advancing past 16:59:00; zero messages delivered. - Restart the desktop app and repeat — behavior unchanged.
期望表现 · Expected behavior
The automation dispatches a run in its owning session at the scheduled time and the prompt (e.g. a reminder) is delivered to the user.
实际表现 · Actual behavior
Nothing is dispatched. The Cron API itself works (create/list/delete succeed; list responded normally except two 30-second timeouts at 17:01–17:02 local).
ZCode version: v3.10.2 (desktop-attached-remote mode; zcode-server.cjs runs on the remote host)
Device / OS: Desktop client attaching over SSH to a Linux VPS — Ubuntu 26.04 LTS (x64, kernel 7.0.0-29-generic), server runs as root.
截图 / 日志 · Evidence / logs
/root/.zcode/cli/log/zcode-2026-09-01.jsonlcontains zero automation/cron dispatch events for the whole day (only the Cron tool calls themselves plus unrelatedlog.retention.*/model.*events). The dispatcher either is not running or logs nothing.- No crash dumps in
/root/.zcode/v2/crash/{live,archive};tasks-index.sqliteintact; the zcode-server process was up the whole time. - Related limitations found while testing: creating a second automation from a session that already owns one fails with "Cannot create a scheduled task inside a session that already belongs to a scheduled task"; and
intervalUnitcombined withrecurring=false/maxRunsis rejected by validation. - Happy to attach full log excerpts if needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CronCreate and CronList flow in zcode-server.cjs, then inspect /root/.zcode/cli/log/zcode-2026-09-01.jsonl for the missing dispatch path. Reproduce the one-shot and recurring cases described in the issue and trace why no automation event occurs after nextRunAt. Done means the owning session receives the prompt at the scheduled time and runCount and nextRunAt update correctly.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100