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

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
罗磊的独立博客
B
Blog
博客园_首页
A
About on SuperTechFans
有赞技术团队
有赞技术团队
V
V2EX
U
Unit 42
I
InfoQ
IT之家
IT之家
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
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 response loop guard (#86324) (#86357) · ope...
udaymanish6 · 2026-05-25 · via Recent Commits to openclaw:main

@@ -1,5 +1,6 @@

11

import type { AssistantMessage } from "@earendil-works/pi-ai";

22

import { describe, expect, it, vi } from "vitest";

3+

import { HEARTBEAT_RESPONSE_TOOL_NAME } from "../auto-reply/heartbeat-tool-response.js";

34

import * as agentEvents from "../infra/agent-events.js";

45

import {

56

THINKING_TAG_CASES,

@@ -1218,4 +1219,61 @@ describe("subscribeEmbeddedPiSession", () => {

12181219

replayInvalid: true,

12191220

});

12201221

});

1222+1223+

it("notifies the runner once when a heartbeat response tool result is recorded", async () => {

1224+

const { session, emit } = createStubSessionHarness();

1225+

const onHeartbeatToolResponse = vi.fn();

1226+

const subscription = subscribeEmbeddedPiSession({

1227+

session,

1228+

runId: "run-heartbeat-terminal",

1229+

sessionKey: "agent:main:main",

1230+

onHeartbeatToolResponse,

1231+

});

1232+1233+

const result = {

1234+

details: {

1235+

status: "recorded",

1236+

outcome: "no_change",

1237+

notify: false,

1238+

summary: "Nothing needs attention.",

1239+

},

1240+

};

1241+

emitToolRun({

1242+

emit,

1243+

toolName: HEARTBEAT_RESPONSE_TOOL_NAME,

1244+

toolCallId: "heartbeat-1",

1245+

args: {

1246+

outcome: "no_change",

1247+

notify: false,

1248+

summary: "Nothing needs attention.",

1249+

},

1250+

isError: false,

1251+

result,

1252+

});

1253+

emitToolRun({

1254+

emit,

1255+

toolName: HEARTBEAT_RESPONSE_TOOL_NAME,

1256+

toolCallId: "heartbeat-2",

1257+

args: {

1258+

outcome: "no_change",

1259+

notify: false,

1260+

summary: "Nothing needs attention.",

1261+

},

1262+

isError: false,

1263+

result,

1264+

});

1265+

await flushBlockReplyCallbacks();

1266+1267+

expect(subscription.getHeartbeatToolResponse()).toEqual({

1268+

outcome: "no_change",

1269+

notify: false,

1270+

summary: "Nothing needs attention.",

1271+

});

1272+

expect(onHeartbeatToolResponse).toHaveBeenCalledTimes(1);

1273+

expect(onHeartbeatToolResponse).toHaveBeenCalledWith({

1274+

outcome: "no_change",

1275+

notify: false,

1276+

summary: "Nothing needs attention.",

1277+

});

1278+

});

12211279

});