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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
D
DataBreaches.Net
宝玉的分享
宝玉的分享
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
人人都是产品经理
人人都是产品经理
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
腾讯CDC
博客园_首页
The Cloudflare Blog
S
SegmentFault 最新的问题
C
Check Point Blog
美团技术团队
爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale

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(doctor): avoid duplicate gateway runtime warnings (#7...
steipete · 2026-05-08 · via Recent Commits to openclaw:main

@@ -38,6 +38,9 @@ const mocks = vi.hoisted(() => ({

3838

resolveIsNixMode: vi.fn(() => false),

3939

findExtraGatewayServices: vi.fn().mockResolvedValue([]),

4040

renderGatewayServiceCleanupHints: vi.fn().mockReturnValue([]),

41+

needsNodeRuntimeMigration: vi.fn(() => false),

42+

renderSystemNodeWarning: vi.fn().mockReturnValue(undefined),

43+

resolveSystemNodeInfo: vi.fn().mockResolvedValue(null),

4144

isSystemdUnitActive: vi.fn().mockResolvedValue(false),

4245

uninstallLegacySystemdUnits: vi.fn().mockResolvedValue([]),

4346

note: vi.fn(),

@@ -62,13 +65,13 @@ vi.mock("../daemon/inspect.js", () => ({

6265

}));

63666467

vi.mock("../daemon/runtime-paths.js", () => ({

65-

renderSystemNodeWarning: vi.fn().mockReturnValue(undefined),

66-

resolveSystemNodeInfo: vi.fn().mockResolvedValue(null),

68+

renderSystemNodeWarning: mocks.renderSystemNodeWarning,

69+

resolveSystemNodeInfo: mocks.resolveSystemNodeInfo,

6770

}));

68716972

vi.mock("../daemon/service-audit.js", () => ({

7073

auditGatewayServiceConfig: mocks.auditGatewayServiceConfig,

71-

needsNodeRuntimeMigration: vi.fn(() => false),

74+

needsNodeRuntimeMigration: mocks.needsNodeRuntimeMigration,

7275

readEmbeddedGatewayToken: readEmbeddedGatewayTokenForTest,

7376

SERVICE_AUDIT_CODES: {

7477

gatewayCommandMissing: testServiceAuditCodes.gatewayCommandMissing,

@@ -246,6 +249,9 @@ describe("maybeRepairGatewayServiceConfig", () => {

246249

vi.clearAllMocks();

247250

fsMocks.realpath.mockImplementation(async (value: string) => value);

248251

mocks.resolveGatewayPort.mockReturnValue(18789);

252+

mocks.needsNodeRuntimeMigration.mockReturnValue(false);

253+

mocks.renderSystemNodeWarning.mockReturnValue(undefined);

254+

mocks.resolveSystemNodeInfo.mockResolvedValue(null);

249255

mocks.isSystemdUnitActive.mockResolvedValue(false);

250256

mocks.resolveGatewayAuthTokenForService.mockImplementation(async (cfg: OpenClawConfig, env) => {

251257

const configToken =

@@ -303,6 +309,50 @@ describe("maybeRepairGatewayServiceConfig", () => {

303309

expect(mocks.install).toHaveBeenCalledTimes(1);

304310

});

305311312+

it("does not duplicate gateway runtime warnings already emitted by the node install plan", async () => {

313+

const nvmNode = "/home/orin/.nvm/versions/node/v22.22.2/bin/node";

314+

mocks.readCommand.mockResolvedValue({

315+

programArguments: [nvmNode, "/usr/local/bin/openclaw", "gateway", "--port", "18789"],

316+

environment: {},

317+

});

318+

mocks.buildGatewayInstallPlan.mockImplementation(async ({ warn }) => {

319+

warn?.(

320+

"System Node 20.20.2 at /usr/bin/node is below the required Node 22.16+. Using /home/orin/.nvm/versions/node/v22.22.2/bin/node for the daemon.",

321+

"Gateway runtime",

322+

);

323+

return {

324+

programArguments: [nvmNode, "/usr/local/bin/openclaw", "gateway", "--port", "18789"],

325+

workingDirectory: "/tmp",

326+

environment: {},

327+

};

328+

});

329+

mocks.auditGatewayServiceConfig.mockResolvedValue({

330+

ok: true,

331+

issues: [{ code: "runtime", message: "runtime migration", level: "recommended" }],

332+

});

333+

mocks.needsNodeRuntimeMigration.mockReturnValue(true);

334+

mocks.resolveSystemNodeInfo.mockResolvedValue({

335+

path: "/usr/bin/node",

336+

version: "20.20.2",

337+

supported: false,

338+

});

339+

mocks.renderSystemNodeWarning.mockReturnValue("duplicate doctor runtime warning");

340+341+

await runRepair({ gateway: {} });

342+343+

const runtimeNotes = mocks.note.mock.calls.filter(([, title]) => title === "Gateway runtime");

344+

const runtimeMessages = runtimeNotes.map(([message]) => message);

345+

expect(runtimeMessages).not.toContain("duplicate doctor runtime warning");

346+

expect(runtimeMessages).not.toEqual(

347+

expect.arrayContaining([expect.stringContaining("not found")]),

348+

);

349+

expect(runtimeMessages).toEqual(

350+

expect.arrayContaining([

351+

expect.stringContaining("Using /home/orin/.nvm/versions/node/v22.22.2/bin/node"),

352+

]),

353+

);

354+

});

355+306356

it("passes planned managed env keys into service audit for legacy inline secret detection", async () => {

307357

mocks.readCommand.mockResolvedValue({

308358

programArguments: gatewayProgramArguments,