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

推荐订阅源

云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
腾讯CDC
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Martin Fowler
Martin Fowler
A
About on SuperTechFans
博客园 - 叶小钗

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: require infra helper results · openclaw/openclaw@c1...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

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

1010

readGatewayRestartHandoffSync,

1111

writeGatewayRestartHandoffSync,

1212

} from "./restart-handoff.js";

13+

import type { GatewayRestartHandoff } from "./restart-handoff.js";

13141415

const tempDirs: string[] = [];

1516

@@ -26,6 +27,16 @@ function handoffPath(env: NodeJS.ProcessEnv): string {

2627

return path.join(env.OPENCLAW_STATE_DIR ?? "", GATEWAY_SUPERVISOR_RESTART_HANDOFF_FILENAME);

2728

}

282930+

function expectWrittenHandoff(

31+

opts: Parameters<typeof writeGatewayRestartHandoffSync>[0],

32+

): GatewayRestartHandoff {

33+

const handoff = writeGatewayRestartHandoffSync(opts);

34+

if (handoff === null) {

35+

throw new Error("Expected gateway restart handoff to be written");

36+

}

37+

return handoff;

38+

}

39+2940

describe("gateway restart handoff", () => {

3041

afterEach(() => {

3142

for (const dir of tempDirs.splice(0)) {

@@ -68,16 +79,14 @@ describe("gateway restart handoff", () => {

6879

it("consumes a fresh handoff by exited pid instead of current process pid", () => {

6980

const env = createHandoffEnv();

708171-

expect(

72-

writeGatewayRestartHandoffSync({

73-

env,

74-

pid: process.pid + 1,

75-

reason: "update.run",

76-

restartKind: "update-process",

77-

supervisorMode: "systemd",

78-

createdAt: 2_000,

79-

}),

80-

).not.toBeNull();

82+

expectWrittenHandoff({

83+

env,

84+

pid: process.pid + 1,

85+

reason: "update.run",

86+

restartKind: "update-process",

87+

supervisorMode: "systemd",

88+

createdAt: 2_000,

89+

});

81908291

expect(

8392

consumeGatewayRestartHandoffForExitedProcessSync({

@@ -97,15 +106,13 @@ describe("gateway restart handoff", () => {

97106

it("rejects handoffs for a different exited pid and clears them", () => {

98107

const env = createHandoffEnv();

99108100-

expect(

101-

writeGatewayRestartHandoffSync({

102-

env,

103-

pid: 111,

104-

restartKind: "full-process",

105-

supervisorMode: "external",

106-

createdAt: 1_000,

107-

}),

108-

).not.toBeNull();

109+

expectWrittenHandoff({

110+

env,

111+

pid: 111,

112+

restartKind: "full-process",

113+

supervisorMode: "external",

114+

createdAt: 1_000,

115+

});

109116110117

expect(

111118

consumeGatewayRestartHandoffForExitedProcessSync({

@@ -120,16 +127,14 @@ describe("gateway restart handoff", () => {

120127

it("rejects a handoff when the supplied process instance does not match", () => {

121128

const env = createHandoffEnv();

122129123-

expect(

124-

writeGatewayRestartHandoffSync({

125-

env,

126-

pid: 111,

127-

processInstanceId: "gateway-instance-1",

128-

restartKind: "full-process",

129-

supervisorMode: "external",

130-

createdAt: 1_000,

131-

}),

132-

).not.toBeNull();

130+

expectWrittenHandoff({

131+

env,

132+

pid: 111,

133+

processInstanceId: "gateway-instance-1",

134+

restartKind: "full-process",

135+

supervisorMode: "external",

136+

createdAt: 1_000,

137+

});

133138134139

expect(

135140

consumeGatewayRestartHandoffForExitedProcessSync({

@@ -168,16 +173,14 @@ describe("gateway restart handoff", () => {

168173

it("rejects expired and oversized handoff files", () => {

169174

const env = createHandoffEnv();

170175171-

expect(

172-

writeGatewayRestartHandoffSync({

173-

env,

174-

pid: 111,

175-

restartKind: "full-process",

176-

supervisorMode: "external",

177-

createdAt: 1_000,

178-

ttlMs: 1_000,

179-

}),

180-

).not.toBeNull();

176+

expectWrittenHandoff({

177+

env,

178+

pid: 111,

179+

restartKind: "full-process",

180+

supervisorMode: "external",

181+

createdAt: 1_000,

182+

ttlMs: 1_000,

183+

});

181184

expect(readGatewayRestartHandoffSync(env, 2_001)).toBeNull();

182185183186

fs.writeFileSync(handoffPath(env), "x".repeat(8192), { encoding: "utf8", mode: 0o600 });

@@ -231,14 +234,12 @@ describe("gateway restart handoff", () => {

231234

return;

232235

}

233236234-

expect(

235-

writeGatewayRestartHandoffSync({

236-

env,

237-

pid: 12_345,

238-

restartKind: "full-process",

239-

supervisorMode: "external",

240-

}),

241-

).not.toBeNull();

237+

expectWrittenHandoff({

238+

env,

239+

pid: 12_345,

240+

restartKind: "full-process",

241+

supervisorMode: "external",

242+

});

242243243244

expect(fs.readFileSync(targetPath, "utf8")).toBe("keep");

244245

expect(fs.lstatSync(handoffPath(env)).isSymbolicLink()).toBe(false);