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

推荐订阅源

L
LangChain Blog
J
Java Code Geeks
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
雷峰网
雷峰网
D
DataBreaches.Net
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
V
Visual Studio Blog
Apple Machine Learning Research
Apple Machine Learning Research
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta

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): quarantine malformed persisted jobs · openclaw...
2026-05-29 · via Recent Commits to openclaw:main

@@ -2,6 +2,7 @@ import fs from "node:fs/promises";

22

import path from "node:path";

33

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

44

import { setupCronServiceSuite } from "../service.test-harness.js";

5+

import { resolveCronQuarantinePath } from "../store.js";

56

import { assertSupportedJobSpec, findJobOrThrow } from "./jobs.js";

67

import { createCronServiceState } from "./state.js";

78

import { ensureLoaded } from "./store.js";

@@ -16,7 +17,7 @@ async function writeSingleJobStore(storePath: string, job: Record<string, unknow

1617

await writeJobStore(storePath, [job]);

1718

}

181919-

async function writeJobStore(storePath: string, jobs: Array<Record<string, unknown>>) {

20+

async function writeJobStore(storePath: string, jobs: unknown[]) {

2021

await fs.mkdir(path.dirname(storePath), { recursive: true });

2122

await fs.writeFile(storePath, JSON.stringify({ version: 1, jobs }, null, 2), "utf8");

2223

}

@@ -122,7 +123,7 @@ describe("cron service store load: missing sessionTarget", () => {

122123

expect(() => assertSupportedJobSpec(bogus)).toThrow(/missing sessionTarget/);

123124

});

124125125-

it("skips malformed persisted schedule and payload shapes without rewriting the store", async () => {

126+

it("quarantines malformed persisted schedule and payload shapes while sanitizing the store", async () => {

126127

const { storePath } = await makeStorePath();

127128128129

await writeJobStore(storePath, [

@@ -199,7 +200,6 @@ describe("cron service store load: missing sessionTarget", () => {

199200

state: {},

200201

},

201202

]);

202-

const beforeRaw = await fs.readFile(storePath, "utf-8");

203203

const warnSpy = vi.spyOn(logger, "warn");

204204205205

const state = createStoreTestState(storePath);

@@ -208,11 +208,24 @@ describe("cron service store load: missing sessionTarget", () => {

208208209209

expect(state.store?.jobs.map((job) => job.id)).toEqual(["valid-job"]);

210210

expect(findJobOrThrow(state, "valid-job").state.nextRunAtMs).toBe(STORE_TEST_NOW);

211-

await expect(fs.readFile(storePath, "utf-8")).resolves.toBe(beforeRaw);

211+

const sanitized = JSON.parse(await fs.readFile(storePath, "utf-8")) as {

212+

jobs: Array<Record<string, unknown>>;

213+

};

214+

expect(sanitized.jobs.map((job) => job.id)).toEqual(["valid-job"]);

215+

const quarantine = JSON.parse(

216+

await fs.readFile(resolveCronQuarantinePath(storePath), "utf-8"),

217+

) as { jobs: Array<{ job?: Record<string, unknown> }> };

218+

expect(quarantine.jobs.map((entry) => entry.job?.id)).toEqual([

219+

"bad-schedule",

220+

"bad-payload",

221+

"bad-cron-expr",

222+

"bad-system-event-text",

223+

"bad-agent-turn-message",

224+

]);

212225213226

const invalidShapeWarns = warnSpy.mock.calls.filter((call) => {

214227

const msg = typeof call[1] === "string" ? call[1] : "";

215-

return msg.includes("skipped invalid persisted job");

228+

return msg.includes("quarantined invalid persisted job");

216229

});

217230

expect(invalidShapeWarns).toHaveLength(5);

218231

expect(invalidShapeWarns.map((call) => (call[0] as { reason?: string }).reason)).toEqual([