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

推荐订阅源

The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
Engineering at Meta
Engineering at Meta
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
I
InfoQ
S
SegmentFault 最新的问题
博客园 - 叶小钗
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
IT之家
IT之家
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
月光博客
月光博客
The Cloudflare Blog
U
Unit 42
GbyAI
GbyAI
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure 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(live): reject loose heartbeat intervals · openclaw/op...
vincentkoc · 2026-05-30 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -69,12 +69,20 @@ export function buildTestLiveEnv(args, baseEnv = process.env) {

6969

};

7070

}

7171
72-

function parsePositiveInt(value, fallback) {

73-

if (!value) {

74-

return fallback;

72+

export function resolveTestLiveHeartbeatMs(baseEnv = process.env) {

73+

const value = baseEnv.OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS;

74+

if (value === undefined || value === "") {

75+

return 20_000;

7576

}

76-

const parsed = Number.parseInt(value, 10);

77-

return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;

77+

const text = value.trim();

78+

if (!/^\d+$/u.test(text)) {

79+

throw new Error(`invalid OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: ${text}`);

80+

}

81+

const parsed = Number(text);

82+

if (!Number.isSafeInteger(parsed) || parsed <= 0) {

83+

throw new Error(`invalid OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: ${text}`);

84+

}

85+

return parsed;

7886

}

7987
8088

export function buildTestLivePnpmArgs(args) {

@@ -96,7 +104,7 @@ export function main(argv = process.argv.slice(2), baseEnv = process.env) {

96104

}

97105
98106

const env = buildTestLiveEnv(args, baseEnv);

99-

const heartbeatMs = parsePositiveInt(baseEnv.OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS, 20_000);

107+

const heartbeatMs = resolveTestLiveHeartbeatMs(baseEnv);

100108

const startedAt = Date.now();

101109

let lastOutputAt = startedAt;

102110
Original file line numberDiff line numberDiff line change

@@ -4,6 +4,7 @@ import {

44

buildTestLiveEnv,

55

buildTestLivePnpmArgs,

66

parseTestLiveArgs,

7+

resolveTestLiveHeartbeatMs,

78

} from "../../scripts/test-live.mjs";

89
910

describe("scripts/test-live", () => {

@@ -66,6 +67,22 @@ describe("scripts/test-live", () => {

6667

});

6768

});

6869
70+

it("rejects loose heartbeat intervals instead of parsing prefixes", () => {

71+

expect(resolveTestLiveHeartbeatMs({})).toBe(20_000);

72+

expect(resolveTestLiveHeartbeatMs({ OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: "2500" })).toBe(

73+

2500,

74+

);

75+

expect(() =>

76+

resolveTestLiveHeartbeatMs({ OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: "1e3" }),

77+

).toThrow("invalid OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: 1e3");

78+

expect(() =>

79+

resolveTestLiveHeartbeatMs({ OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: "1000ms" }),

80+

).toThrow("invalid OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: 1000ms");

81+

expect(() =>

82+

resolveTestLiveHeartbeatMs({ OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: "0" }),

83+

).toThrow("invalid OPENCLAW_LIVE_WRAPPER_HEARTBEAT_MS: 0");

84+

});

85+
6986

it("prints help without spawning live Vitest", () => {

7087

const result = spawnSync(process.execPath, ["scripts/test-live.mjs", "--help"], {

7188

cwd: process.cwd(),