惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
B
Blog
博客园_首页
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
罗磊的独立博客
Jina AI
Jina AI
C
Check Point Blog
Martin Fowler
Martin Fowler
J
Java Code Geeks
博客园 - 司徒正美
美团技术团队
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
小众软件
小众软件

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(cron): clear delivery routing fields from cron edit (...
ly-wang19 · 2026-06-16 · via Recent Commits to openclaw:main
11

// Cron edit register tests cover cron edit command registration and option wiring.

22

import { Command } from "commander";

33

import { beforeEach, describe, expect, it, vi } from "vitest";

4+

import { defaultRuntime } from "../../runtime.js";

4556

const callGatewayFromCli = vi.fn();

67

@@ -228,4 +229,114 @@ describe("cron edit command", () => {

228229

expect(help).toContain("--clear-model");

229230

expect(help).toContain("--clear-tools");

230231

});

232+233+

it("clears the delivery channel with --clear-channel (CLI parity with cron.update channel:null)", async () => {

234+

const program = createCronProgram();

235+236+

await program.parseAsync(["edit", "job-1", "--clear-channel"], { from: "user" });

237+238+

expect(callGatewayFromCli).toHaveBeenCalledWith(

239+

"cron.update",

240+

expect.objectContaining({ clearChannel: true }),

241+

{

242+

id: "job-1",

243+

patch: { delivery: { channel: null } },

244+

},

245+

);

246+

});

247+248+

it("clears the delivery destination with --clear-to", async () => {

249+

const program = createCronProgram();

250+251+

await program.parseAsync(["edit", "job-1", "--clear-to"], { from: "user" });

252+253+

expect(callGatewayFromCli).toHaveBeenCalledWith(

254+

"cron.update",

255+

expect.objectContaining({ clearTo: true }),

256+

{

257+

id: "job-1",

258+

patch: { delivery: { to: null } },

259+

},

260+

);

261+

});

262+263+

it("clears the delivery thread id with --clear-thread-id", async () => {

264+

const program = createCronProgram();

265+266+

await program.parseAsync(["edit", "job-1", "--clear-thread-id"], { from: "user" });

267+268+

expect(callGatewayFromCli).toHaveBeenCalledWith(

269+

"cron.update",

270+

expect.objectContaining({ clearThreadId: true }),

271+

{

272+

id: "job-1",

273+

patch: { delivery: { threadId: null } },

274+

},

275+

);

276+

});

277+278+

it("clears the delivery account override with --clear-account", async () => {

279+

const program = createCronProgram();

280+281+

await program.parseAsync(["edit", "job-1", "--clear-account"], { from: "user" });

282+283+

expect(callGatewayFromCli).toHaveBeenCalledWith(

284+

"cron.update",

285+

expect.objectContaining({ clearAccount: true }),

286+

{

287+

id: "job-1",

288+

patch: { delivery: { accountId: null } },

289+

},

290+

);

291+

});

292+293+

it.each([

294+

{ set: "--channel", value: "telegram", clear: "--clear-channel" },

295+

{ set: "--to", value: "12345", clear: "--clear-to" },

296+

{ set: "--thread-id", value: "42", clear: "--clear-thread-id" },

297+

{ set: "--account", value: "writer", clear: "--clear-account" },

298+

])("rejects $set combined with $clear", async ({ set, value, clear }) => {

299+

const errorSpy = vi.spyOn(defaultRuntime, "error").mockImplementation(() => {});

300+

const exitSpy = vi.spyOn(defaultRuntime, "exit").mockImplementation((() => undefined) as never);

301+

const program = createCronProgram();

302+303+

await program.parseAsync(["edit", "job-1", set, value, clear], { from: "user" });

304+305+

expect(errorSpy).toHaveBeenCalledWith(

306+

expect.stringContaining(`Use ${set} or ${clear}, not both`),

307+

);

308+

expect(callGatewayFromCli).not.toHaveBeenCalled();

309+310+

errorSpy.mockRestore();

311+

exitSpy.mockRestore();

312+

});

313+314+

it("rejects --webhook combined with a delivery clear flag", async () => {

315+

const errorSpy = vi.spyOn(defaultRuntime, "error").mockImplementation(() => {});

316+

const exitSpy = vi.spyOn(defaultRuntime, "exit").mockImplementation((() => undefined) as never);

317+

const program = createCronProgram();

318+319+

await program.parseAsync(

320+

["edit", "job-1", "--webhook", "https://example.invalid/hook", "--clear-channel"],

321+

{ from: "user" },

322+

);

323+324+

expect(errorSpy).toHaveBeenCalledWith(

325+

expect.stringContaining("--webhook cannot be combined with chat delivery options."),

326+

);

327+

expect(callGatewayFromCli).not.toHaveBeenCalled();

328+329+

errorSpy.mockRestore();

330+

exitSpy.mockRestore();

331+

});

332+333+

it("documents the delivery clear flags alongside the sibling --clear-model", () => {

334+

const editCommand = createCronProgram().commands.find((command) => command.name() === "edit");

335+

const help = editCommand?.helpInformation() ?? "";

336+337+

expect(help).toContain("--clear-channel");

338+

expect(help).toContain("--clear-to");

339+

expect(help).toContain("--clear-thread-id");

340+

expect(help).toContain("--clear-account");

341+

});

231342

});