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

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
The Cloudflare Blog
IT之家
IT之家
雷峰网
雷峰网
小众软件
小众软件
博客园 - 叶小钗
博客园 - 聂微东
爱范儿
爱范儿
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
博客园 - 【当耐特】
V
V2EX
博客园_首页
T
Tailwind CSS Blog

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(agents): keep cron media completions run-scoped · ope...
ai-hpc · 2026-05-26 · via Recent Commits to openclaw:main

@@ -17,6 +17,9 @@ const mocks = vi.hoisted(() => {

1717

return {

1818

stubTool,

1919

createCronToolOptions: vi.fn(),

20+

createImageGenerateToolOptions: vi.fn(),

21+

createMusicGenerateToolOptions: vi.fn(),

22+

createVideoGenerateToolOptions: vi.fn(),

2023

textToSpeech: vi.fn(async () => ({

2124

success: true,

2225

audioPath: "/tmp/openclaw/tts-config-test.opus",

@@ -50,7 +53,10 @@ vi.mock("./tools/gateway-tool.js", () => ({

5053

}));

51545255

vi.mock("./tools/image-generate-tool.js", () => ({

53-

createImageGenerateTool: () => mocks.stubTool("image_generate"),

56+

createImageGenerateTool: (options: unknown) => {

57+

mocks.createImageGenerateToolOptions(options);

58+

return mocks.stubTool("image_generate");

59+

},

5460

}));

55615662

vi.mock("./tools/image-tool.js", () => ({

@@ -62,7 +68,10 @@ vi.mock("./tools/message-tool.js", () => ({

6268

}));

63696470

vi.mock("./tools/music-generate-tool.js", () => ({

65-

createMusicGenerateTool: () => mocks.stubTool("music_generate"),

71+

createMusicGenerateTool: (options: unknown) => {

72+

mocks.createMusicGenerateToolOptions(options);

73+

return mocks.stubTool("music_generate");

74+

},

6675

}));

67766877

vi.mock("./tools/nodes-tool.js", () => ({

@@ -106,7 +115,10 @@ vi.mock("./tools/update-plan-tool.js", () => ({

106115

}));

107116108117

vi.mock("./tools/video-generate-tool.js", () => ({

109-

createVideoGenerateTool: () => mocks.stubTool("video_generate"),

118+

createVideoGenerateTool: (options: unknown) => {

119+

mocks.createVideoGenerateToolOptions(options);

120+

return mocks.stubTool("video_generate");

121+

},

110122

}));

111123112124

vi.mock("./tools/web-tools.js", () => ({

@@ -134,6 +146,9 @@ function getTextToSpeechParams() {

134146

describe("createOpenClawTools TTS config wiring", () => {

135147

beforeEach(() => {

136148

mocks.createCronToolOptions.mockClear();

149+

mocks.createImageGenerateToolOptions.mockClear();

150+

mocks.createMusicGenerateToolOptions.mockClear();

151+

mocks.createVideoGenerateToolOptions.mockClear();

137152

mocks.textToSpeech.mockClear();

138153

});

139154

@@ -266,6 +281,74 @@ describe("createOpenClawTools TTS config wiring", () => {

266281

});

267282

});

268283284+

describe("createOpenClawTools media generation session wiring", () => {

285+

beforeEach(() => {

286+

mocks.createImageGenerateToolOptions.mockClear();

287+

mocks.createMusicGenerateToolOptions.mockClear();

288+

mocks.createVideoGenerateToolOptions.mockClear();

289+

});

290+291+

it("uses the isolated cron run key for background media completions", () => {

292+

const config = {

293+

agents: {

294+

defaults: {

295+

imageGenerationModel: { primary: "image-owner/model" },

296+

videoGenerationModel: { primary: "video-owner/model" },

297+

musicGenerationModel: { primary: "music-owner/model" },

298+

},

299+

},

300+

} satisfies OpenClawConfig;

301+302+

createOpenClawTools({

303+

config,

304+

agentSessionKey: "agent:main:cron:daily-media",

305+

runSessionKey: "agent:main:cron:daily-media:run:run-123",

306+

disableMessageTool: true,

307+

disablePluginTools: true,

308+

});

309+310+

expect(mocks.createImageGenerateToolOptions).toHaveBeenCalledWith(

311+

expect.objectContaining({

312+

agentSessionKey: "agent:main:cron:daily-media:run:run-123",

313+

}),

314+

);

315+

expect(mocks.createVideoGenerateToolOptions).toHaveBeenCalledWith(

316+

expect.objectContaining({

317+

agentSessionKey: "agent:main:cron:daily-media:run:run-123",

318+

}),

319+

);

320+

expect(mocks.createMusicGenerateToolOptions).toHaveBeenCalledWith(

321+

expect.objectContaining({

322+

agentSessionKey: "agent:main:cron:daily-media:run:run-123",

323+

}),

324+

);

325+

});

326+327+

it("keeps the requester session key for non-cron media completions", () => {

328+

const config = {

329+

agents: {

330+

defaults: {

331+

imageGenerationModel: { primary: "image-owner/model" },

332+

},

333+

},

334+

} satisfies OpenClawConfig;

335+336+

createOpenClawTools({

337+

config,

338+

agentSessionKey: "agent:main:slack:channel:C123",

339+

runSessionKey: "agent:main:slack:channel:C123:run:run-123",

340+

disableMessageTool: true,

341+

disablePluginTools: true,

342+

});

343+344+

expect(mocks.createImageGenerateToolOptions).toHaveBeenCalledWith(

345+

expect.objectContaining({

346+

agentSessionKey: "agent:main:slack:channel:C123",

347+

}),

348+

);

349+

});

350+

});

351+269352

describe("createOpenClawTools cron context wiring", () => {

270353

beforeEach(() => {

271354

mocks.createCronToolOptions.mockClear();