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

推荐订阅源

人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
月光博客
月光博客
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
罗磊的独立博客
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
博客园 - 聂微东
V
V2EX

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): refuse keyless implicit isolated cron delivery...
nxmxbbd · 2026-06-19 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -106,7 +106,15 @@ describe("runCronIsolatedAgentTurn cron delivery awareness", () => {

106106

});

107107

});

108108
109-

it("does not queue main-session awareness for implicit last-target delivery", async () => {

109+

it("refuses keyless implicit last-target delivery inherited from the shared main bucket, queuing no awareness", async () => {

110+

// #91613: a keyless implicit cron (sessionTarget "isolated", delivery.channel "last", no `to`)

111+

// would inherit the SHARED agent-main bucket's lastTo. In a multi-conversation agent that room

112+

// belongs to whichever conversation last wrote main — the wrong room — and the durable queue

113+

// replays it after a restart. It is now refused at the delivery dispatch !ok gate (errorKind

114+

// delivery-target) — the agent turn still runs, but delivery is refused, so nothing reaches the

115+

// wrong room or the durable queue, and no main-session awareness event is queued. (This is the

116+

// single-conversation behavior change called out for the maintainer: a keyless cron must now

117+

// pin delivery.to / delivery.channel, or run from a session that carries its own context.)

110118

await withTempCronHome(async (home) => {

111119

const storePath = await writeDefaultAgentSessionStoreEntries({

112120

"agent:main:main": {

@@ -131,8 +139,8 @@ describe("runCronIsolatedAgentTurn cron delivery awareness", () => {

131139

},

132140

});

133141
134-

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

135-

expect(result.delivered).toBe(true);

142+

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

143+

expect(result.delivered).toBeFalsy();

136144

expect(peekSystemEvents("agent:main:main")).toStrictEqual([]);

137145

});

138146

});

Original file line numberDiff line numberDiff line change

@@ -1175,6 +1175,79 @@ describe("dispatchCronDelivery — double-announce guard", () => {

11751175

expect(retireSessionMcpRuntime).not.toHaveBeenCalled();

11761176

});

11771177
1178+

it("cleans up the direct cron session when delivery target resolution is refused (deleteAfterRun)", async () => {

1179+

// A keyless implicit cron whose inherited shared-bucket target is refused

1180+

// (resolvedDelivery.ok=false, issue #91613 fail-closed path) must still

1181+

// retire its session/transcript when deleteAfterRun is enabled — otherwise

1182+

// the one-shot session leaks.

1183+

const params = makeBaseParams({ synthesizedText: "refused report" });

1184+

params.resolvedDelivery = {

1185+

ok: false,

1186+

channel: "telegram",

1187+

to: undefined,

1188+

accountId: undefined,

1189+

threadId: undefined,

1190+

mode: "implicit",

1191+

error: new Error("refusing inherited shared-bucket delivery target"),

1192+

};

1193+

params.agentSessionKey = "agent:main:cron:test-job";

1194+

(params.job as { deleteAfterRun?: boolean }).deleteAfterRun = true;

1195+
1196+

const state = await dispatchCronDelivery(params);

1197+
1198+

expect(deliverOutboundPayloads).not.toHaveBeenCalled();

1199+

expectResultFields(state.result, {

1200+

status: "error",

1201+

errorKind: "delivery-target",

1202+

});

1203+

expect(callGateway).toHaveBeenCalledWith({

1204+

method: "sessions.delete",

1205+

params: {

1206+

key: "agent:main:cron:test-job",

1207+

deleteTranscript: true,

1208+

emitLifecycleHooks: false,

1209+

},

1210+

timeoutMs: 10_000,

1211+

});

1212+

});

1213+
1214+

it("cleans up the direct cron session when refused delivery is best-effort (deleteAfterRun)", async () => {

1215+

// Same fail-closed refusal, best-effort variant: dispatch returns status:ok

1216+

// (warn-logs instead of failing the run) but the deleteAfterRun session must

1217+

// still be retired.

1218+

const params = makeBaseParams({

1219+

synthesizedText: "refused report",

1220+

deliveryBestEffort: true,

1221+

});

1222+

params.resolvedDelivery = {

1223+

ok: false,

1224+

channel: "telegram",

1225+

to: undefined,

1226+

accountId: undefined,

1227+

threadId: undefined,

1228+

mode: "implicit",

1229+

error: new Error("refusing inherited shared-bucket delivery target"),

1230+

};

1231+

params.agentSessionKey = "agent:main:cron:test-job";

1232+

(params.job as { deleteAfterRun?: boolean }).deleteAfterRun = true;

1233+
1234+

const state = await dispatchCronDelivery(params);

1235+
1236+

expect(deliverOutboundPayloads).not.toHaveBeenCalled();

1237+

expectResultFields(state.result, {

1238+

status: "ok",

1239+

});

1240+

expect(callGateway).toHaveBeenCalledWith({

1241+

method: "sessions.delete",

1242+

params: {

1243+

key: "agent:main:cron:test-job",

1244+

deleteTranscript: true,

1245+

emitLifecycleHooks: false,

1246+

},

1247+

timeoutMs: 10_000,

1248+

});

1249+

});

1250+
11781251

it("text delivery fires exactly once (no double-deliver)", async () => {

11791252

vi.mocked(deliverOutboundPayloads).mockResolvedValue([{ ok: true } as never]);

11801253
Original file line numberDiff line numberDiff line change

@@ -1219,6 +1219,12 @@ export async function dispatchCronDelivery(

12191219
12201220

if (params.deliveryRequested && !params.skipHeartbeatDelivery && !sourceDeliverySatisfied) {

12211221

if (!params.resolvedDelivery.ok) {

1222+

// The target could not be resolved (e.g. a keyless implicit cron whose

1223+

// inherited shared-bucket target was refused). We never send here, so a

1224+

// deleteAfterRun cron must still retire its session/transcript before

1225+

// returning — otherwise the one-shot session leaks. Safe no-op for

1226+

// non-deleteAfterRun / non-cron sessions (see cleanupDirectCronSession).

1227+

await cleanupDirectCronSessionIfNeeded();

12221228

if (!params.deliveryBestEffort) {

12231229

return {

12241230

result: failDeliveryTarget(params.resolvedDelivery.error.message),