From 8608d29075dacf31175d3f8c97e3b021799963b9 Mon Sep 17 00:00:00 2001 From: cnb Date: Wed, 22 Jul 2026 13:26:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(cron):=20schedule.delay.unit=20=E8=A1=A5?= =?UTF-8?q?=E4=B8=8A=20type:=20"string"=EF=BC=8C=E4=BF=AE=E5=A4=8D=20moons?= =?UTF-8?q?hot=20schema=20=E6=A0=A1=E9=AA=8C=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRON_SCHEDULE_SCHEMA 的 delay 分支中 unit 字段仅有 enum 缺少 type, 导致 moonshot 在加载 cron_create 工具时校验失败: tools.function.parameters is not a valid moonshot flavored json schema → At path 'properties.schedule.anyOf.properties.unit': type is not defined 从而使所有依赖该工具的 agent 对话返回「服务暂时不可用」。 --- src/cron/tool/CronSchemas.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cron/tool/CronSchemas.ts b/src/cron/tool/CronSchemas.ts index 752f9f822..2e78c807f 100644 --- a/src/cron/tool/CronSchemas.ts +++ b/src/cron/tool/CronSchemas.ts @@ -26,7 +26,7 @@ export const CRON_SCHEDULE_SCHEMA = { properties: { type: { const: "delay" }, amount: { type: "number", exclusiveMinimum: 0 }, - unit: { enum: ["second", "minute", "hour", "day"] }, + unit: { type: "string", enum: ["second", "minute", "hour", "day"] }, }, }, ],