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

推荐订阅源

博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
云风的 BLOG
云风的 BLOG
D
Docker
罗磊的独立博客
U
Unit 42
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
P
Proofpoint News Feed
博客园 - Franky
Apple Machine Learning Research
Apple Machine Learning Research
MyScale Blog
MyScale Blog
B
Blog RSS Feed
美团技术团队
J
Java Code Geeks
S
Securelist
Cyberwarzone
Cyberwarzone
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
NISL@THU
NISL@THU
Security Latest
Security Latest
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Recorded Future
Recorded Future
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 热门话题
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
A
About on SuperTechFans
MongoDB | Blog
MongoDB | Blog
Spread Privacy
Spread Privacy
T
Tenable Blog
I
Intezer
N
News | PayPal Newsroom
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX - 技术
S
Schneier on Security
S
SegmentFault 最新的问题
Latest news
Latest news
宝玉的分享
宝玉的分享
V
Visual Studio Blog
V
V2EX
T
Tor Project blog
C
Comments on: Blog

Recent Commits to openclaw:main

fix(macos): prevent duplicate menu bar icons · openclaw/openclaw@e18099b perf(agents): avoid full setup registry for runtime aliases · openclaw/openclaw@a52c4d1 fix(agents): prevent embedded runtime shadowing · openclaw/openclaw@4ef141d fix(outbound): route source replies through configured channels · openclaw/openclaw@1955f42 perf: reduce tui refresh work feat: default exec shell snapshots fix(ui): keep chat usable during session loading fix(cron): guard flat atMs canonicalization refactor(cron): keep runtime on canonical sqlite rows fix(codex): restore bounded recovery continuity · openclaw/openclaw@827ceb5 refactor: clean up ACP package metadata and helpers (#88659) · openclaw/openclaw@7b78941 fix(discord): ping mention-bearing final replies · openclaw/openclaw@a5d8f09 fix(telegram): preserve usage footer for tool-only replies · openclaw/openclaw@8f941ea fix(agents): avoid alias setup load for matching refs · openclaw/openclaw@b334e7e chore(ui): translate thinking default label fix(agents): preserve runtime tools in lean mode (#88381) fix(messages): use best-effort for implicit tool-only source replies … docs: raise bulk PR close threshold · openclaw/openclaw@66775c0 feat: add exec shell snapshot cache · openclaw/openclaw@c389839 fix: use typed tui empty session defaults · openclaw/openclaw@50c6519 perf: speed up tui session refresh · openclaw/openclaw@18dc6e5 fix(ci): align agent thinking default surfaces · openclaw/openclaw@9a4b631 docs: require live batch issue verification · openclaw/openclaw@832b648 ci(release): extend QA runtime parity timeout · openclaw/openclaw@d689893 ci: stabilize Testbox changed checks · openclaw/openclaw@d1bec46 fix(agents): report stale session locks without cleanup · openclaw/openclaw@7ca7712 fix(gateway): reject stale lifecycle session updates · openclaw/openclaw@fb7e217 docs(agents): require typed presentation actions · openclaw/openclaw@88c99dd fix(models): keep auth login out of main config · openclaw/openclaw@1bfae9d fix: guard stale lifecycle snapshots (#88583) fix(gateway): reject pre-reset run lifecycle events from clobbering r… · openclaw/openclaw@613f51a fix: apply ACP spawn model defaults · openclaw/openclaw@ff22b1e fix(agents): accept disabled thinking params fix(gateway): expose agent thinking defaults · openclaw/openclaw@f8f5259 ci: use normal node_modules for Blacksmith Testbox · openclaw/openclaw@d99934a fix(agents): inherit subagent thinking defaults fix(plugins): scope tool callbacks during materialization · openclaw/openclaw@643633c fix(plugins): remove redundant proxy assertion · openclaw/openclaw@82a0ba8 fix(agents): keep async media starts nonterminal · openclaw/openclaw@3ebbf9a fix(plugins): preserve wrapped tool descriptors · openclaw/openclaw@f62a22c fix(codex): let async media coexist with terminal batches fix(plugins): delegate wrapped tool properties · openclaw/openclaw@d99c824 fix(codex): clear completed dynamic tool release blockers fix(gateway): enforce OpenAI tool_choice contracts feat: add MCP code-mode namespace (#88636) fix(agents): avoid synthetic tool results during parallel races · openclaw/openclaw@44c65de fix(e2e): show plugins docker sweep progress · openclaw/openclaw@0833c68 docs: require gh comment drafts · openclaw/openclaw@f2ace9f docs: require codex source citations · openclaw/openclaw@036acbd fix(agents): release session lock on manual abort · openclaw/openclaw@95890fe docs: clarify autoreview refactor follow-up · openclaw/openclaw@a7075f3 fix(agents): scope timeout cooldowns by model · openclaw/openclaw@582fea9 test(discord): drive application id retry timer · openclaw/openclaw@d927e73 docs: strengthen review dependency inspection rules refactor: expand acp core package (#88618) · openclaw/openclaw@7dea283 fix(doctor): diagnose malformed provider catalogs · openclaw/openclaw@cc29005 fix(agents): normalize prefixed Anthropic model ids (#88587) · openclaw/openclaw@826b378 chore: bump OpenClaw version to 2026.5.31 · openclaw/openclaw@0d17623 feat(codex): add portable Codex command pickers (#82224) fix(tui): preserve pending local runs during session sync (#87959) · openclaw/openclaw@5a0e677 docs: clarify inline code comments · openclaw/openclaw@85beee6 fix(auto-reply): warn on substantive private message-tool finals · openclaw/openclaw@75e0053 fix(tui): use middle truncation for paths and commands in tool displa… · openclaw/openclaw@81b9da0 fix(webchat): suppress stale active session rows (#87962) · openclaw/openclaw@e452d16 fix(tui): skip history reload when final event has displayable output… · openclaw/openclaw@9a1b95c test(discord): isolate timer-sensitive request tests · openclaw/openclaw@5dc4531 fix(e2e): heartbeat resource-sampled docker lanes fix(auth): coerce persisted device auth tokens refactor: unify subagent handoffs into agent steering queue fix(tasks): reclaim ACP zombie runs blocking gateway restart (#88281) · openclaw/openclaw@02c7b5b test(release): wait for bundled runtime commands · openclaw/openclaw@100dd79 fix(hooks): isolate slug-generator auth failures · openclaw/openclaw@318cae1 docs: require issue summaries in agent replies · openclaw/openclaw@17c8602 docs: clarify agent workflow rules refactor(openai): confine legacy codex repair to doctor · openclaw/openclaw@7423e9c fix(auto-reply): honor per-model thinking params · openclaw/openclaw@2f7e6ec refactor(cron): keep legacy notify migration in doctor · openclaw/openclaw@b222b5f fix(exec): allow predicate shell builtins in allowlist mode · openclaw/openclaw@2fe019c test(voice-call): drive Twilio stream failure timers · openclaw/openclaw@657a668 fix(diagnostics): surface Bonjour state in support exports · openclaw/openclaw@c797f02 perf(cli): narrow gateway dispatch startup · openclaw/openclaw@32c0279 docs: tighten refactor storage policy · openclaw/openclaw@44512b5 docs: require PR review transparency · openclaw/openclaw@f1fc204 docs: clarify runtime migration boundary fix(agents): preserve reasoning replay from model metadata · openclaw/openclaw@cf315dd test(release): harden beta validation gates fix(exec): allow known safe shell builtins in allowlist mode · openclaw/openclaw@fee4e52 docs: explain per-agent model params refactor: move plugin state stores to sqlite (#88609) fix: preserve discord policy close narrowing · openclaw/openclaw@fd88f34 fix: queue subagent completion handoffs (#88613) docs(codex): clarify first-party plugin marketplaces · openclaw/openclaw@729712d docs: tighten env surface policy · openclaw/openclaw@97a97ad docs: tighten config surface policy · openclaw/openclaw@2e25400 fix(devices): refresh paired device last-seen metadata · openclaw/openclaw@703fae1 fix(agents): classify expired thinking signatures (#88340) · openclaw/openclaw@fdf8ddd fix(browser): document stable tab references (#88393) · openclaw/openclaw@3a88142 fix(discord): log gateway websocket close details · openclaw/openclaw@94b1427 chore(lint): trim remaining suppressions · openclaw/openclaw@f83886c test(release): stabilize beta validation after rebase
refactor(cron): split tool and doctor repair helpers · openclaw/openclaw@cd3b467
steipete · 2026-05-31 · via Recent Commits to openclaw:main

@@ -0,0 +1,262 @@

1+

import { timestampMsToIsoString } from "@openclaw/normalization-core/number-coercion";

2+

import { isRecord } from "../../utils.js";

3+4+

const CRON_SCHEDULE_KINDS = ["at", "every", "cron"] as const;

5+

const CRON_PAYLOAD_KINDS = ["systemEvent", "agentTurn"] as const;

6+

const CRON_FLAT_PAYLOAD_KEYS = [

7+

"message",

8+

"text",

9+

"model",

10+

"fallbacks",

11+

"toolsAllow",

12+

"thinking",

13+

"timeoutSeconds",

14+

"lightContext",

15+

"allowUnsafeExternalContent",

16+

] as const;

17+

const CRON_FLAT_SCHEDULE_KEYS = [

18+

"kind",

19+

"at",

20+

"atMs",

21+

"every",

22+

"everyMs",

23+

"anchorMs",

24+

"cron",

25+

"expr",

26+

"tz",

27+

"stagger",

28+

"staggerMs",

29+

"exact",

30+

] as const;

31+

const CRON_RECOVERABLE_OBJECT_KEYS: ReadonlySet<string> = new Set([

32+

"name",

33+

"schedule",

34+

"sessionTarget",

35+

"wakeMode",

36+

"payload",

37+

"delivery",

38+

"enabled",

39+

"description",

40+

"deleteAfterRun",

41+

"agentId",

42+

"sessionKey",

43+

"failureAlert",

44+

...CRON_FLAT_PAYLOAD_KEYS,

45+

...CRON_FLAT_SCHEDULE_KEYS,

46+

]);

47+48+

function isCronScheduleKind(value: unknown): value is (typeof CRON_SCHEDULE_KINDS)[number] {

49+

return value === "at" || value === "every" || value === "cron";

50+

}

51+52+

function isCronPayloadKind(value: unknown): value is (typeof CRON_PAYLOAD_KINDS)[number] {

53+

return value === "systemEvent" || value === "agentTurn";

54+

}

55+56+

function isNonEmptyString(value: unknown): value is string {

57+

return typeof value === "string" && value.trim().length > 0;

58+

}

59+60+

function isStringArrayOrNull(value: unknown): boolean {

61+

return (

62+

value === null || (Array.isArray(value) && value.every((entry) => typeof entry === "string"))

63+

);

64+

}

65+66+

function moveDefinedField(params: {

67+

source: Record<string, unknown>;

68+

target: Record<string, unknown>;

69+

from: string;

70+

to?: string;

71+

}): boolean {

72+

if (params.source[params.from] === undefined) {

73+

return false;

74+

}

75+

params.target[params.to ?? params.from] = params.source[params.from];

76+

delete params.source[params.from];

77+

return true;

78+

}

79+80+

function setScheduleAtMs(schedule: Record<string, unknown>, value: unknown): void {

81+

const atMs = typeof value === "number" ? value : Number(value);

82+

schedule.at = Number.isFinite(atMs) ? (timestampMsToIsoString(Math.floor(atMs)) ?? value) : value;

83+

}

84+85+

function canonicalizeCronToolSchedule(value: Record<string, unknown>): void {

86+

const schedule = isRecord(value.schedule) ? { ...value.schedule } : {};

87+

let hasSchedule = isRecord(value.schedule);

88+89+

if (schedule.atMs !== undefined) {

90+

setScheduleAtMs(schedule, schedule.atMs);

91+

delete schedule.atMs;

92+

if (!isCronScheduleKind(schedule.kind)) {

93+

schedule.kind = "at";

94+

}

95+

}

96+

if (schedule.everyMs === undefined && schedule.every !== undefined) {

97+

schedule.everyMs = schedule.every;

98+

delete schedule.every;

99+

}

100+

if (schedule.expr === undefined && schedule.cron !== undefined) {

101+

schedule.expr = schedule.cron;

102+

delete schedule.cron;

103+

}

104+

if (schedule.staggerMs === undefined && schedule.stagger !== undefined) {

105+

schedule.staggerMs = schedule.stagger;

106+

delete schedule.stagger;

107+

}

108+

if (schedule.exact === true && schedule.staggerMs === undefined) {

109+

schedule.staggerMs = 0;

110+

}

111+

delete schedule.exact;

112+113+

if (isCronScheduleKind(value.kind) && !isCronScheduleKind(schedule.kind)) {

114+

schedule.kind = value.kind;

115+

delete value.kind;

116+

hasSchedule = true;

117+

}

118+119+

const movedAt = moveDefinedField({ source: value, target: schedule, from: "at" });

120+

if (movedAt && !isCronScheduleKind(schedule.kind)) {

121+

schedule.kind = "at";

122+

}

123+124+

if (value.atMs !== undefined) {

125+

setScheduleAtMs(schedule, value.atMs);

126+

delete value.atMs;

127+

if (!isCronScheduleKind(schedule.kind)) {

128+

schedule.kind = "at";

129+

}

130+

hasSchedule = true;

131+

}

132+133+

const movedEveryMs =

134+

moveDefinedField({ source: value, target: schedule, from: "everyMs" }) ||

135+

moveDefinedField({ source: value, target: schedule, from: "every", to: "everyMs" });

136+

if (movedEveryMs && !isCronScheduleKind(schedule.kind)) {

137+

schedule.kind = "every";

138+

}

139+140+

const movedCron =

141+

moveDefinedField({ source: value, target: schedule, from: "cron", to: "expr" }) ||

142+

moveDefinedField({ source: value, target: schedule, from: "expr" });

143+

if (movedCron && !isCronScheduleKind(schedule.kind)) {

144+

schedule.kind = "cron";

145+

}

146+147+

for (const key of ["anchorMs", "tz", "staggerMs"] as const) {

148+

hasSchedule = moveDefinedField({ source: value, target: schedule, from: key }) || hasSchedule;

149+

}

150+

hasSchedule =

151+

moveDefinedField({ source: value, target: schedule, from: "stagger", to: "staggerMs" }) ||

152+

hasSchedule;

153+154+

if (value.exact === true && schedule.staggerMs === undefined) {

155+

schedule.staggerMs = 0;

156+

hasSchedule = true;

157+

}

158+

delete value.exact;

159+160+

if (!isCronScheduleKind(schedule.kind)) {

161+

if (schedule.at !== undefined) {

162+

schedule.kind = "at";

163+

} else if (schedule.everyMs !== undefined) {

164+

schedule.kind = "every";

165+

} else if (schedule.expr !== undefined) {

166+

schedule.kind = "cron";

167+

}

168+

}

169+170+

if (hasSchedule || Object.keys(schedule).length > 0) {

171+

value.schedule = schedule;

172+

}

173+

}

174+175+

function canonicalizeCronToolPayload(value: Record<string, unknown>): void {

176+

const payload = isRecord(value.payload) ? { ...value.payload } : {};

177+

let hasPayload = isRecord(value.payload);

178+179+

for (const key of CRON_FLAT_PAYLOAD_KEYS) {

180+

hasPayload = moveDefinedField({ source: value, target: payload, from: key }) || hasPayload;

181+

}

182+183+

if (isCronPayloadKind(value.kind) && !isCronPayloadKind(payload.kind)) {

184+

payload.kind = value.kind;

185+

delete value.kind;

186+

hasPayload = true;

187+

}

188+189+

if (!isCronPayloadKind(payload.kind)) {

190+

const hasAgentTurnSignal =

191+

isNonEmptyString(payload.message) ||

192+

isNonEmptyString(payload.model) ||

193+

isNonEmptyString(payload.thinking) ||

194+

typeof payload.timeoutSeconds === "number" ||

195+

typeof payload.lightContext === "boolean" ||

196+

typeof payload.allowUnsafeExternalContent === "boolean" ||

197+

(payload.fallbacks !== undefined && isStringArrayOrNull(payload.fallbacks)) ||

198+

(payload.toolsAllow !== undefined && isStringArrayOrNull(payload.toolsAllow));

199+

if (hasAgentTurnSignal) {

200+

payload.kind = "agentTurn";

201+

} else if (isNonEmptyString(payload.text)) {

202+

payload.kind = "systemEvent";

203+

}

204+

}

205+206+

if (hasPayload || Object.keys(payload).length > 0) {

207+

value.payload = payload;

208+

}

209+

}

210+211+

export function canonicalizeCronToolObject(

212+

value: Record<string, unknown>,

213+

): Record<string, unknown> {

214+

const unwrapped = isRecord(value.data) ? value.data : isRecord(value.job) ? value.job : value;

215+

const next = { ...unwrapped };

216+

canonicalizeCronToolSchedule(next);

217+

canonicalizeCronToolPayload(next);

218+

return next;

219+

}

220+221+

export function isEmptyRecoveredCronPatch(value: unknown): boolean {

222+

if (!isRecord(value)) {

223+

return true;

224+

}

225+

const keys = Object.keys(value);

226+

return (

227+

keys.length === 0 ||

228+

(keys.length === 1 &&

229+

keys[0] === "payload" &&

230+

isRecord(value.payload) &&

231+

Object.keys(value.payload).length === 0)

232+

);

233+

}

234+235+

export function recoverCronObjectFromFlatParams(params: Record<string, unknown>): {

236+

found: boolean;

237+

value: Record<string, unknown>;

238+

} {

239+

const value: Record<string, unknown> = {};

240+

let found = false;

241+

for (const key of Object.keys(params)) {

242+

if (CRON_RECOVERABLE_OBJECT_KEYS.has(key) && params[key] !== undefined) {

243+

value[key] = params[key];

244+

found = true;

245+

}

246+

}

247+

return { found, value: canonicalizeCronToolObject(value) };

248+

}

249+250+

export function hasCronCreateSignal(value: Record<string, unknown>): boolean {

251+

return (

252+

value.schedule !== undefined ||

253+

value.at !== undefined ||

254+

value.atMs !== undefined ||

255+

value.everyMs !== undefined ||

256+

value.cron !== undefined ||

257+

value.expr !== undefined ||

258+

value.payload !== undefined ||

259+

value.message !== undefined ||

260+

value.text !== undefined

261+

);

262+

}