MoonshotAI / MoonshotAI/kimi-code
[Bug/FR] cron 定时任务无任何用户可见入口:持续消耗 token 却无法查看和关闭
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
问题描述
模型通过 CronCreate 工具创建的定时任务,用户在 TUI 里完全没有任何查看/管理入口:
- 没有 /cron 之类的斜杠命令
- /tasks 面板只显示后台任务(shell 命令、子代理),不显示定时调度任务
- 官方文档的 Slash Commands 章节也没有任何关于 cron 任务的用户入口说明
任务实际持久化在 ~/.kimi-code/cron/<工作目录哈希>/<任务ID>.json,普通用户无从得知这个位置,也不应手动改 JSON。
真实案例(本人亲历)
我让 Kimi Code 监视一个 GitHub PR 的 review 动态,它创建了一个 每 8 分钟触发一次 的 cron 任务,每次触发都投递一条长提示词并发起一轮完整的 LLM 调用:
- 任务 ID:
01M051V5GFXVTNHGNVGDPSVZ26 - cron 表达式:
*/8 * * * *(每天 180 次触发) - 存储位置:
C:\Users\<user>\.kimi-code\cron\wd_<hash>_<hash>\01M051V5GFXVTNHGNVGDPSVZ26.json
之后我想在 UI 里找到这个任务看看状态、调整频率——翻遍所有斜杠命令和 /tasks 面板都找不到。最后还是靠问模型本人,才得知任务文件的存在。也就是说:一个每天固定消耗上百轮 token 的任务,用户对它既看不见、也关不掉。
为什么这是 bug 级的问题
- 持续消耗 token,用户无感知:cron 每次触发都是一轮真实 LLM 调用(参见 #2390:cron 空转烧掉 ~7M token)。没有入口意味着用户连"它在烧配额"这件事都不知道。
- 无法自助关闭:取消、改频率只能"求模型帮忙"。模型不在场、换了客户端、或者会话卡住时,用户没有任何办法停掉它。
- 多会话场景下风险被放大:很多用户(包括我)会在 Web 端/桌面端同时开着多个会话。cron 任务绑定会话、后台静默运行,用户不可能时刻盯着每个会话有没有被模型建了定时任务——极易造成 token 长期空转而不自知。
期望行为
参考 Codex 的做法:在侧边栏有一级入口「已安排(Scheduled)」,所有定时任务醒目列出,随时可查看、可关闭。
希望 Kimi Code 提供等价能力,任一即可:
- TUI 侧边栏/面板增加「定时任务」一级入口,醒目展示、随时可关闭(对齐 Codex「已安排」)
- 或新增 /cron 斜杠命令,支持列出 / 取消 / 修改当前会话的定时任务
- 或并入 /tasks 面板统一展示和管理
- 至少在文档中说明定时任务的存在、存储位置和管理方式
相关 issue
- #2173(状态栏显示 cron 状态)被标记 not planned 关闭——本 issue 范围更广且性质更严重:不只是状态展示,而是用户连最基本的"感知存在 + 自助关闭"能力都没有,且直接关系到配额损耗。
环境
- Kimi Code CLI,Windows 11
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 by tracing the CronCreate tool, the /tasks panel, and the Slash Commands documentation, then inspect how persisted cron files under ~/.kimi-code/cron// are handled. Done means users can discover scheduled tasks, view their status, and cancel or modify them through a supported CLI or TUI entry point without editing JSON manually.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100