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

推荐订阅源

V
V2EX
Y
Y Combinator Blog
博客园_首页
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
宝玉的分享
宝玉的分享
B
Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
WordPress大学
WordPress大学
L
LangChain Blog
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
博客园 - 聂微东
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Help Net Security

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 heartbeat message-tool delivery policy (#85357) · ope...
neeravmakwan · 2026-05-23 · via Recent Commits to openclaw:main

@@ -33,19 +33,34 @@ describe("runHeartbeatOnce heartbeat response tool", () => {

3333

tmpDir: string;

3434

storePath: string;

3535

visibleReplies?: "automatic" | "message_tool";

36+

groupVisibleReplies?: "automatic" | "message_tool";

3637

agentRuntimeId?: string;

38+

modelRuntimeId?: string;

3739

model?: string;

40+

target?: "telegram" | "last";

3841

}): OpenClawConfig {

3942

return {

4043

agents: {

4144

defaults: {

4245

workspace: params.tmpDir,

43-

heartbeat: { every: "5m", target: "telegram" },

46+

heartbeat: { every: "5m", target: params.target ?? "telegram" },

4447

...(params.model ? { model: params.model } : {}),

48+

...(params.model && params.modelRuntimeId

49+

? { models: { [params.model]: { agentRuntime: { id: params.modelRuntimeId } } } }

50+

: {}),

4551

...(params.agentRuntimeId ? { agentRuntime: { id: params.agentRuntimeId } } : {}),

4652

},

4753

},

48-

...(params.visibleReplies ? { messages: { visibleReplies: params.visibleReplies } } : {}),

54+

...(params.visibleReplies || params.groupVisibleReplies

55+

? {

56+

messages: {

57+

...(params.visibleReplies ? { visibleReplies: params.visibleReplies } : {}),

58+

...(params.groupVisibleReplies

59+

? { groupChat: { visibleReplies: params.groupVisibleReplies } }

60+

: {}),

61+

},

62+

}

63+

: {}),

4964

channels: {

5065

telegram: {

5166

token: "test-token",

@@ -228,6 +243,15 @@ describe("runHeartbeatOnce heartbeat response tool", () => {

228243

expectHeartbeatToolPrompt(result, ["notify=false"]);

229244

});

230245246+

it("uses the heartbeat response tool prompt for group message-tool mode", async () => {

247+

const result = await runPromptScenario({

248+

config: { groupVisibleReplies: "message_tool", target: "last" },

249+

session: { lastTo: "group:redacted" },

250+

});

251+252+

expectHeartbeatToolPrompt(result, ["notify=false"]);

253+

});

254+231255

it("uses the heartbeat response tool prompt for Codex harness sessions by default", async () => {

232256

const result = await runPromptScenario({

233257

session: { agentHarnessId: "codex" },

@@ -316,6 +340,31 @@ describe("runHeartbeatOnce heartbeat response tool", () => {

316340

expectHeartbeatToolPrompt(result);

317341

});

318342343+

it("uses the heartbeat response tool prompt for model-specific Codex runtimes", async () => {

344+

const result = await runPromptScenario({

345+

config: {

346+

model: "openai/gpt-5.5",

347+

modelRuntimeId: "codex",

348+

},

349+

});

350+351+

expectHeartbeatToolPrompt(result);

352+

});

353+354+

it("honors model-specific non-Codex runtimes over default Codex heartbeat mode", async () => {

355+

const result = await runPromptScenario({

356+

config: {

357+

agentRuntimeId: "codex",

358+

model: "openai/gpt-5.5",

359+

modelRuntimeId: "pi",

360+

},

361+

});

362+363+

expect(result.calledCtx.Body).toContain("HEARTBEAT_OK");

364+

expect(result.calledCtx.Body).not.toContain("heartbeat_respond");

365+

expect(result.calledOpts.sourceReplyDeliveryMode).toBeUndefined();

366+

});

367+319368

it("uses the heartbeat response tool prompt when the Codex runtime is env-forced", async () => {

320369

vi.stubEnv("OPENCLAW_AGENT_RUNTIME", "codex");

321370

const result = await runPromptScenario({