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

推荐订阅源

H
Help Net Security
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
雷峰网
雷峰网
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园 - 叶小钗
D
DataBreaches.Net
D
Docker
月光博客
月光博客
博客园 - 司徒正美
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell

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
test: tighten heartbeat model assertions · openclaw/openc...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -21,6 +21,16 @@ type SeedSessionInput = {

2121

type AgentDefaultsConfig = NonNullable<NonNullable<OpenClawConfig["agents"]>["defaults"]>;

2222

type HeartbeatConfig = NonNullable<AgentDefaultsConfig["heartbeat"]>;

232324+

function expectReplyOptions(options: unknown, expected: Record<string, unknown>) {

25+

expect(typeof options).toBe("object");

26+

expect(options).not.toBeNull();

27+

const actual = options as Record<string, unknown>;

28+

for (const [key, value] of Object.entries(expected)) {

29+

expect(actual[key]).toEqual(value);

30+

}

31+

return actual;

32+

}

33+2434

async function withHeartbeatFixture(

2535

run: (ctx: {

2636

tmpDir: string;

@@ -155,56 +165,49 @@ describe("runHeartbeatOnce – heartbeat model override", () => {

155165

replySpy,

156166

});

157167158-

expect(result.replySpy).toHaveBeenCalledWith(

159-

expect.any(Object),

160-

expect.objectContaining({

161-

isHeartbeat: true,

162-

...params.expectedOptions,

163-

}),

164-

cfg,

165-

);

168+

expect(result.replySpy).toHaveBeenCalledTimes(1);

169+

const [ctx, opts, passedConfig] = result.replySpy.mock.calls[0] ?? [];

170+

expect(typeof ctx).toBe("object");

171+

expect(ctx).not.toBeNull();

172+

expectReplyOptions(opts, {

173+

isHeartbeat: true,

174+

...params.expectedOptions,

175+

});

176+

expect(passedConfig).toBe(cfg);

166177

});

167178

}

168179169180

it("passes heartbeatModelOverride from defaults heartbeat config", async () => {

170181

const replyOpts = await runDefaultsHeartbeat({ model: "ollama/llama3.2:1b" });

171-

expect(replyOpts).toEqual(

172-

expect.objectContaining({

173-

isHeartbeat: true,

174-

heartbeatModelOverride: "ollama/llama3.2:1b",

175-

suppressToolErrorWarnings: false,

176-

}),

177-

);

182+

expectReplyOptions(replyOpts, {

183+

isHeartbeat: true,

184+

heartbeatModelOverride: "ollama/llama3.2:1b",

185+

suppressToolErrorWarnings: false,

186+

});

178187

});

179188180189

it("passes suppressToolErrorWarnings when configured", async () => {

181190

const replyOpts = await runDefaultsHeartbeat({ suppressToolErrorWarnings: true });

182-

expect(replyOpts).toEqual(

183-

expect.objectContaining({

184-

isHeartbeat: true,

185-

suppressToolErrorWarnings: true,

186-

}),

187-

);

191+

expectReplyOptions(replyOpts, {

192+

isHeartbeat: true,

193+

suppressToolErrorWarnings: true,

194+

});

188195

});

189196190197

it("passes heartbeat timeoutSeconds as a reply-run timeout override", async () => {

191198

const replyOpts = await runDefaultsHeartbeat({ timeoutSeconds: 45 });

192-

expect(replyOpts).toEqual(

193-

expect.objectContaining({

194-

isHeartbeat: true,

195-

timeoutOverrideSeconds: 45,

196-

}),

197-

);

199+

expectReplyOptions(replyOpts, {

200+

isHeartbeat: true,

201+

timeoutOverrideSeconds: 45,

202+

});

198203

});

199204200205

it("passes bootstrapContextMode when heartbeat lightContext is enabled", async () => {

201206

const replyOpts = await runDefaultsHeartbeat({ lightContext: true });

202-

expect(replyOpts).toEqual(

203-

expect.objectContaining({

204-

isHeartbeat: true,

205-

bootstrapContextMode: "lightweight",

206-

}),

207-

);

207+

expectReplyOptions(replyOpts, {

208+

isHeartbeat: true,

209+

bootstrapContextMode: "lightweight",

210+

});

208211

});

209212210213

it("uses isolated session key when isolatedSession is enabled", async () => {

@@ -295,20 +298,15 @@ describe("runHeartbeatOnce – heartbeat model override", () => {

295298296299

it("does not pass heartbeatModelOverride when no heartbeat model is configured", async () => {

297300

const replyOpts = await runDefaultsHeartbeat({ model: undefined });

298-

expect(replyOpts).toEqual(

299-

expect.objectContaining({

300-

isHeartbeat: true,

301-

}),

302-

);

301+

const actual = expectReplyOptions(replyOpts, { isHeartbeat: true });

302+

expect(actual.heartbeatModelOverride).toBeUndefined();

303303

});

304304305305

it("trims heartbeat model override before passing it downstream", async () => {

306306

const replyOpts = await runDefaultsHeartbeat({ model: " ollama/llama3.2:1b " });

307-

expect(replyOpts).toEqual(

308-

expect.objectContaining({

309-

isHeartbeat: true,

310-

heartbeatModelOverride: "ollama/llama3.2:1b",

311-

}),

312-

);

307+

expectReplyOptions(replyOpts, {

308+

isHeartbeat: true,

309+

heartbeatModelOverride: "ollama/llama3.2:1b",

310+

});

313311

});

314312

});