zai-org / zai-org/feedback

[Bug] Scheduled automations never dispatch — runCount stays 0, cron API works

Open
#464 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
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

  1. In any chat, ask the agent to set a one-shot reminder a few minutes ahead (CronCreate reports success, nextRunAt is set correctly).
  2. Wait past the scheduled fire time (verified up to 40+ minutes later).
  3. Run CronList: the automation is still lifecycleStatus=active with runCount=0; no message arrives.
  4. Control test: cron * * * * *, recurring=false, maxRuns=5, created 16:58:40 local — all 5 fire times passed by 17:03:40 with runCount=0 and nextRunAt never advancing past 16:59:00; zero messages delivered.
  5. 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.jsonl contains zero automation/cron dispatch events for the whole day (only the Cron tool calls themselves plus unrelated log.retention.* / model.* events). The dispatcher either is not running or logs nothing.
  • No crash dumps in /root/.zcode/v2/crash/{live,archive}; tasks-index.sqlite intact; 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 intervalUnit combined with recurring=false / maxRuns is rejected by validation.
  • Happy to attach full log excerpts if needed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.