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

推荐订阅源

WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
DataBreaches.Net
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
IT之家
IT之家
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
月光博客
月光博客
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
腾讯CDC
B
Blog RSS Feed
博客园 - Franky
爱范儿
爱范儿

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): preserve isolated agent turn payload message (...
849261680 · 2026-06-08 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -39,6 +39,31 @@ function requireModelFallbackRequest(): {

3939

describe("runCronIsolatedAgentTurn — payload.fallbacks", () => {

4040

setupRunCronIsolatedAgentTurnSuite({ fast: true });

4141
42+

it("uses the persisted agentTurn payload message when the dispatch message is malformed", async () => {

43+

mockRunCronFallbackPassthrough();

44+

const dispatchMessage = "SERIALIZATION_PROBE should not be wrapped";

45+
46+

const result = await runCronIsolatedAgentTurn(

47+

makeIsolatedAgentTurnParams({

48+

job: makeIsolatedAgentTurnJob({

49+

payload: {

50+

kind: "agentTurn",

51+

message:

52+

"SERIALIZATION_PROBE: reply exactly with the marker token you received and nothing else.",

53+

},

54+

}),

55+

message: { message: dispatchMessage } as unknown as string,

56+

}),

57+

);

58+
59+

expect(result.status).toBe("ok");

60+

expect(runEmbeddedAgentMock).toHaveBeenCalledOnce();

61+

const request = runEmbeddedAgentMock.mock.calls[0]?.[0] as { prompt?: unknown } | undefined;

62+

expect(request?.prompt).toContain("SERIALIZATION_PROBE: reply exactly");

63+

expect(request?.prompt).not.toContain(dispatchMessage);

64+

expect(request?.prompt).not.toContain("[object Object]");

65+

});

66+
4267

it.each([

4368

{

4469

name: "passes payload.fallbacks as fallbacksOverride when defined",

Original file line numberDiff line numberDiff line change

@@ -456,6 +456,13 @@ type RunCronAgentTurnParams = {

456456

lane?: string;

457457

};

458458
459+

function resolveCronAgentTurnMessage(input: RunCronAgentTurnParams): string {

460+

if (input.job.payload.kind === "agentTurn") {

461+

return input.job.payload.message;

462+

}

463+

return input.message;

464+

}

465+
459466

type WithRunSession = (

460467

result: Omit<RunCronAgentTurnResult, "sessionId" | "sessionKey">,

461468

) => RunCronAgentTurnResult;

@@ -765,7 +772,8 @@ async function prepareCronRunContext(params: {

765772

});

766773
767774

const { formattedTime, timeLine } = resolveCronStyleNow(input.cfg, now);

768-

const base = `[cron:${input.job.id} ${input.job.name}] ${input.message}`.trim();

775+

const message = resolveCronAgentTurnMessage(input);

776+

const base = `[cron:${input.job.id} ${input.job.name}] ${message}`.trim();

769777

const isExternalHook =

770778

hookExternalContentSource !== undefined || isExternalHookSession(baseSessionKey);

771779

const allowUnsafeExternalContent =

@@ -776,7 +784,7 @@ async function prepareCronRunContext(params: {

776784
777785

if (isExternalHook) {

778786

const { detectSuspiciousPatterns } = await loadCronExternalContentRuntime();

779-

const suspiciousPatterns = detectSuspiciousPatterns(input.message);

787+

const suspiciousPatterns = detectSuspiciousPatterns(message);

780788

if (suspiciousPatterns.length > 0) {

781789

logWarn(

782790

`[security] Suspicious patterns detected in external hook content ` +

@@ -789,7 +797,7 @@ async function prepareCronRunContext(params: {

789797

const { buildSafeExternalPrompt } = await loadCronExternalContentRuntime();

790798

const hookType = mapHookExternalContentSource(hookExternalContentSource ?? "webhook");

791799

const safeContent = buildSafeExternalPrompt({

792-

content: input.message,

800+

content: message,

793801

source: hookType,

794802

jobName: input.job.name,

795803

jobId: input.job.id,

Original file line numberDiff line numberDiff line change

@@ -264,6 +264,41 @@ describe("cron service ops regressions", () => {

264264

expect((staleExecuted?.state.nextRunAtMs ?? 0) > nowMs).toBe(true);

265265

});

266266
267+

it("passes the rehydrated agentTurn payload message to isolated manual runs", async () => {

268+

const store = opsRegressionFixtures.makeStorePath();

269+

const nowMs = Date.now();

270+

const marker =

271+

"SERIALIZATION_PROBE: reply exactly with the marker token you received and nothing else.";

272+

const job = createIsolatedRegressionJob({

273+

id: "manual-payload-message",

274+

name: "manual payload message",

275+

scheduledAt: nowMs,

276+

schedule: { kind: "at", at: new Date(nowMs + 3_600_000).toISOString() },

277+

payload: { kind: "agentTurn", message: marker },

278+

state: { nextRunAtMs: nowMs + 3_600_000 },

279+

});

280+

await saveCronStore(store.storePath, { version: 1, jobs: [job] });

281+
282+

const runIsolatedAgentJob = vi.fn().mockResolvedValue({ status: "ok", summary: "ok" });

283+

const state = createCronServiceState({

284+

cronEnabled: false,

285+

storePath: store.storePath,

286+

log: noopLogger,

287+

enqueueSystemEvent: vi.fn(),

288+

requestHeartbeat: vi.fn(),

289+

runIsolatedAgentJob,

290+

});

291+
292+

const runResult = await run(state, job.id, "force");

293+
294+

expect(runResult).toEqual({ ok: true, ran: true });

295+

expect(runIsolatedAgentJob).toHaveBeenCalledOnce();

296+

const [params] = requireMockCall(runIsolatedAgentJob, 0, "runIsolatedAgentJob") as [

297+

{ message?: unknown }?,

298+

];

299+

expect(params?.message).toBe(marker);

300+

});

301+
267302

it("applies timeoutSeconds to manual cron.run isolated executions", async () => {

268303

vi.useFakeTimers();

269304

try {