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

推荐订阅源

J
Java Code Geeks
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
G
Google Developers Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
MyScale Blog
MyScale Blog
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
爱范儿
爱范儿
罗磊的独立博客
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
C
Check Point Blog
美团技术团队
宝玉的分享
宝玉的分享
Microsoft Security Blog
Microsoft Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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: avoid fresh launchd repair kickstart · openclaw/open...
steipete · 2026-05-04 · via Recent Commits to openclaw:main

@@ -8,6 +8,7 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest";

88

import {

99

installLaunchAgent,

1010

readLaunchAgentRuntime,

11+

repairLaunchAgentBootstrap,

1112

restartLaunchAgent,

1213

resolveLaunchAgentPlistPath,

1314

stopLaunchAgent,

@@ -37,6 +38,10 @@ function canRunLaunchdIntegration(): boolean {

37383839

const describeLaunchdIntegration = canRunLaunchdIntegration() ? describe : describe.skip;

394041+

function resolveGuiDomain(): string {

42+

return `gui/${process.getuid?.() ?? 501}`;

43+

}

44+4045

async function withTimeout<T>(params: {

4146

run: () => Promise<T>;

4247

timeoutMs: number;

@@ -133,6 +138,29 @@ async function initializeLaunchdRuntime(launchEnv: GatewayServiceEnv, stdout: Pa

133138

});

134139

}

135140141+

async function writeLaunchAgentProbeScript(params: {

142+

eventsPath: string;

143+

scriptPath: string;

144+

}): Promise<void> {

145+

await fs.writeFile(

146+

params.scriptPath,

147+

[

148+

'const fs = require("node:fs");',

149+

`const eventsPath = ${JSON.stringify(params.eventsPath)};`,

150+

"fs.appendFileSync(eventsPath, `start ${process.pid}\\n`);",

151+

'for (const signal of ["SIGHUP", "SIGINT", "SIGTERM"]) {',

152+

" process.on(signal, () => {",

153+

" fs.appendFileSync(eventsPath, `${signal} ${process.pid}\\n`);",

154+

" process.exit(0);",

155+

" });",

156+

"}",

157+

"setInterval(() => {}, 1000);",

158+

"",

159+

].join("\n"),

160+

"utf8",

161+

);

162+

}

163+136164

async function expectRuntimePidReplaced(params: {

137165

env: GatewayServiceEnv;

138166

previousPid: number;

@@ -231,4 +259,42 @@ describeLaunchdIntegration("launchd integration", () => {

231259

await restartLaunchAgent({ env: launchEnv, stdout });

232260

await expectRuntimePidReplaced({ env: launchEnv, previousPid: before.pid });

233261

}, 60_000);

262+263+

it("repairs a missing bootstrap without kickstarting the fresh LaunchAgent", async () => {

264+

const launchEnv = launchEnvOrThrow(env);

265+

const eventsPath = path.join(homeDir, "repair-probe.events.log");

266+

const scriptPath = path.join(homeDir, "repair-probe.cjs");

267+

await writeLaunchAgentProbeScript({ eventsPath, scriptPath });

268+

await installLaunchAgent({

269+

env: launchEnv,

270+

stdout,

271+

programArguments: [process.execPath, scriptPath],

272+

});

273+

await waitForRunningRuntime({ env: launchEnv });

274+

const bootout = spawnSync(

275+

"launchctl",

276+

["bootout", resolveGuiDomain(), resolveLaunchAgentPlistPath(launchEnv)],

277+

{ encoding: "utf8" },

278+

);

279+

expect(bootout.status).toBe(0);

280+

await waitForNotRunningRuntime({ env: launchEnv });

281+

await fs.access(resolveLaunchAgentPlistPath(launchEnv));

282+

await fs.writeFile(eventsPath, "", "utf8");

283+284+

const repair = await withTimeout({

285+

run: async () => repairLaunchAgentBootstrap({ env: launchEnv }),

286+

timeoutMs: STARTUP_TIMEOUT_MS,

287+

message: "Timed out repairing launchd integration runtime",

288+

});

289+

expect(repair).toEqual({ ok: true, status: "repaired" });

290+

await waitForRunningRuntime({ env: launchEnv });

291+292+

await new Promise((resolve) => {

293+

setTimeout(resolve, 1_500);

294+

});

295+

const events = await fs.readFile(eventsPath, "utf8");

296+

const lines = events.trim().split(/\r?\n/).filter(Boolean);

297+

expect(lines.filter((line) => line.startsWith("start "))).toHaveLength(1);

298+

expect(lines.some((line) => /^(SIGHUP|SIGINT|SIGTERM) /.test(line))).toBe(false);

299+

}, 60_000);

234300

});