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

推荐订阅源

人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
月光博客
月光博客
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
小众软件
小众软件
量子位
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

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: guard launchd handoff mock calls · openclaw/opencla...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -13,6 +13,25 @@ vi.mock("node:child_process", async () => {

13131414

import { scheduleDetachedLaunchdRestartHandoff } from "./launchd-restart-handoff.js";

151516+

type SpawnCall = [string, string[], { env: Record<string, string | undefined> }];

17+18+

function requireSpawnCall(callIndex = 0): SpawnCall {

19+

const call = spawnMock.mock.calls.at(callIndex);

20+

if (!call) {

21+

throw new Error(`expected spawn call ${callIndex}`);

22+

}

23+

const [command, args, options] = call;

24+

if (

25+

typeof command !== "string" ||

26+

!Array.isArray(args) ||

27+

!options ||

28+

typeof options !== "object"

29+

) {

30+

throw new Error(`expected spawn call ${callIndex} with command, args, and options`);

31+

}

32+

return [command, args as string[], options as SpawnCall[2]];

33+

}

34+1635

afterEach(() => {

1736

spawnMock.mockReset();

1837

unrefMock.mockReset();

@@ -35,7 +54,7 @@ describe("scheduleDetachedLaunchdRestartHandoff", () => {

35543655

expect(result).toEqual({ ok: true, pid: 4242 });

3756

expect(spawnMock).toHaveBeenCalledTimes(1);

38-

const [, args] = spawnMock.mock.calls[0] as [string, string[]];

57+

const [, args] = requireSpawnCall();

3958

expect(args[0]).toBe("-c");

4059

expect(args[2]).toBe("openclaw-launchd-restart-handoff");

4160

expect(args[6]).toBe("9876");

@@ -64,7 +83,7 @@ describe("scheduleDetachedLaunchdRestartHandoff", () => {

6483

mode: "start-after-exit",

6584

});

668567-

const [, args] = spawnMock.mock.calls[0] as [string, string[]];

86+

const [, args] = requireSpawnCall();

6887

expect(args[7]).toBe("ai.openclaw.gateway");

6988

expect(args[1]).toContain('if launchctl print "$service_target" >/dev/null 2>&1; then');

7089

expect(args[1]).toContain("reason=launchd-auto-reload");

@@ -89,11 +108,7 @@ describe("scheduleDetachedLaunchdRestartHandoff", () => {

89108

mode: "kickstart",

90109

});

9111092-

const [, args, options] = spawnMock.mock.calls[0] as [

93-

string,

94-

string[],

95-

{ env: Record<string, string | undefined> },

96-

];

111+

const [, args, options] = requireSpawnCall();

97112

expect(args[1]).toContain("exec >>'/Users/test/.openclaw/logs/gateway-restart.log' 2>&1");

98113

expect(args[1]).not.toContain("/tmp/evil-bin");

99114

expect(args[1]).not.toContain("/tmp/evil.dylib");