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

推荐订阅源

爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
U
Unit 42
B
Blog RSS Feed
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
腾讯CDC
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Visual Studio Blog
博客园 - 聂微东
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta

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: harden macOS gateway updates · openclaw/openclaw@a61...
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -22,6 +22,8 @@ const readPackageName = vi.fn();

2222

const readPackageVersion = vi.fn();

2323

const resolveGlobalManager = vi.fn();

2424

const serviceLoaded = vi.fn();

25+

const serviceStop = vi.fn();

26+

const serviceRestart = vi.fn();

2527

const prepareRestartScript = vi.fn();

2628

const runRestartScript = vi.fn();

2729

const mockedRunDaemonInstall = vi.fn();

@@ -187,6 +189,8 @@ vi.mock("../daemon/service.js", () => ({

187189

isLoaded: (...args: unknown[]) => serviceLoaded(...args),

188190

readCommand: (...args: unknown[]) => serviceReadCommand(...args),

189191

readRuntime: (...args: unknown[]) => serviceReadRuntime(...args),

192+

stop: (...args: unknown[]) => serviceStop(...args),

193+

restart: (...args: unknown[]) => serviceRestart(...args),

190194

})),

191195

}));

192196

@@ -470,6 +474,8 @@ describe("update-cli", () => {

470474

readPackageName.mockResolvedValue("openclaw");

471475

readPackageVersion.mockResolvedValue("1.0.0");

472476

resolveGlobalManager.mockResolvedValue("npm");

477+

serviceStop.mockResolvedValue(undefined);

478+

serviceRestart.mockResolvedValue({ outcome: "completed" });

473479

serviceLoaded.mockResolvedValue(false);

474480

serviceReadCommand.mockImplementation(async () =>

475481

(await serviceLoaded()) ? { programArguments: ["openclaw", "gateway", "run"] } : null,

@@ -1389,6 +1395,85 @@ describe("update-cli", () => {

13891395

);

13901396

});

139113971398+

it("stops a running managed gateway before package replacement", async () => {

1399+

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-update-stop-service-"));

1400+

const nodeModules = path.join(tempDir, "node_modules");

1401+

const pkgRoot = path.join(nodeModules, "openclaw");

1402+

const entryPath = path.join(pkgRoot, "dist", "index.js");

1403+

mockPackageInstallStatus(pkgRoot);

1404+

await fs.mkdir(path.dirname(entryPath), { recursive: true });

1405+

await fs.writeFile(

1406+

path.join(pkgRoot, "package.json"),

1407+

JSON.stringify({ name: "openclaw", version: "2026.4.21" }),

1408+

"utf-8",

1409+

);

1410+

await fs.writeFile(entryPath, "export {};\n", "utf-8");

1411+

await writePackageDistInventory(pkgRoot);

1412+

serviceReadCommand.mockResolvedValue({

1413+

programArguments: ["openclaw", "gateway", "run"],

1414+

environment: {

1415+

OPENCLAW_SERVICE_MARKER: "openclaw",

1416+

OPENCLAW_SERVICE_KIND: "gateway",

1417+

},

1418+

});

1419+

serviceLoaded.mockResolvedValue(true);

1420+

serviceReadRuntime.mockResolvedValue({

1421+

status: "running",

1422+

pid: 4242,

1423+

state: "running",

1424+

});

1425+

pathExists.mockImplementation(async (candidate: string) => {

1426+

try {

1427+

await fs.access(candidate);

1428+

return true;

1429+

} catch {

1430+

return false;

1431+

}

1432+

});

1433+

vi.mocked(runCommandWithTimeout).mockImplementation(async (argv) => {

1434+

if (Array.isArray(argv) && argv[0] === "npm" && argv[1] === "root" && argv[2] === "-g") {

1435+

return {

1436+

stdout: `${nodeModules}\n`,

1437+

stderr: "",

1438+

code: 0,

1439+

signal: null,

1440+

killed: false,

1441+

termination: "exit",

1442+

};

1443+

}

1444+

return {

1445+

stdout: "",

1446+

stderr: "",

1447+

code: 0,

1448+

signal: null,

1449+

killed: false,

1450+

termination: "exit",

1451+

};

1452+

});

1453+1454+

await updateCommand({ yes: true });

1455+1456+

const npmInstallCallIndex = vi

1457+

.mocked(runCommandWithTimeout)

1458+

.mock.calls.findIndex(

1459+

(call) => Array.isArray(call[0]) && call[0][0] === "npm" && call[0][1] === "i",

1460+

);

1461+

const npmInstallCallOrder =

1462+

vi.mocked(runCommandWithTimeout).mock.invocationCallOrder[npmInstallCallIndex];

1463+

expect(serviceStop).toHaveBeenCalledWith(

1464+

expect.objectContaining({

1465+

env: expect.objectContaining({

1466+

OPENCLAW_SERVICE_MARKER: "openclaw",

1467+

OPENCLAW_SERVICE_KIND: "gateway",

1468+

}),

1469+

}),

1470+

);

1471+

const serviceStopCallOrder = serviceStop.mock.invocationCallOrder[0];

1472+

expect(serviceStopCallOrder).toBeDefined();

1473+

expect(npmInstallCallOrder).toBeDefined();

1474+

expect(serviceStopCallOrder).toBeLessThan(npmInstallCallOrder);

1475+

});

1476+13921477

it("refreshes package installs even when the current version already matches the target", async () => {

13931478

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-update-current-"));

13941479

const nodeModules = path.join(tempDir, "node_modules");