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

推荐订阅源

爱范儿
爱范儿
博客园_首页
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
MongoDB | Blog
MongoDB | Blog
美团技术团队
H
Help Net Security
G
Google Developers Blog
B
Blog RSS Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
M
MIT News - Artificial intelligence
腾讯CDC
IT之家
IT之家
Vercel News
Vercel News
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
I
InfoQ
博客园 - 司徒正美
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
fix(doctor): skip restart prompt when gateway is healthy ...
liaoyl830 · 2026-05-26 · via Recent Commits to openclaw:main

@@ -312,7 +312,7 @@ describe("maybeRepairGatewayDaemon", () => {

312312

healthOk: false,

313313

});

314314315-

expect(readGatewayRestartHandoffSync).toHaveBeenCalledOnce();

315+

expect(readGatewayRestartHandoffSync).toHaveBeenCalledTimes(2);

316316

const [handoffEnv] = readGatewayRestartHandoffSync.mock.calls[0] as unknown as [

317317

{ OPENCLAW_STATE_DIR?: string; OPENCLAW_CONFIG_PATH?: string },

318318

];

@@ -324,12 +324,12 @@ describe("maybeRepairGatewayDaemon", () => {

324324

);

325325

});

326326327-

it("does not read restart handoffs during normal doctor", async () => {

327+

it("does not inspect port connections during normal doctor", async () => {

328328

setPlatform("linux");

329329330330

await runNonInteractiveRepair();

331331332-

expect(readGatewayRestartHandoffSync).not.toHaveBeenCalled();

332+

expect(readGatewayRestartHandoffSync).toHaveBeenCalled();

333333

expect(inspectPortConnections).not.toHaveBeenCalled();

334334

});

335335

@@ -551,4 +551,74 @@ describe("maybeRepairGatewayDaemon", () => {

551551

expect(service.install).not.toHaveBeenCalled();

552552

expect(note).toHaveBeenCalledWith(EXTERNAL_SERVICE_REPAIR_NOTE, "Gateway LaunchAgent");

553553

});

554+555+

it("skips restart prompt when gateway is healthy after recent restart handoff in normal doctor flow", async () => {

556+

vi.useFakeTimers();

557+

vi.setSystemTime(40_000);

558+

setPlatform("linux");

559+

const handoff = {

560+

kind: "gateway-supervisor-restart-handoff" as const,

561+

version: 1 as const,

562+

intentId: "intent-healthy",

563+

pid: 99_999,

564+

createdAt: 35_000,

565+

expiresAt: 95_000,

566+

reason: "update.run",

567+

source: "gateway-update" as const,

568+

restartKind: "update-process" as const,

569+

supervisorMode: "systemd" as const,

570+

} satisfies GatewayRestartHandoff;

571+

readGatewayRestartHandoffSync.mockReturnValue(handoff);

572+573+

await maybeRepairGatewayDaemon({

574+

cfg: { gateway: {} },

575+

runtime: { log: vi.fn(), error: vi.fn(), exit: vi.fn() },

576+

prompter: createPrompter(() => true),

577+

options: { deep: false },

578+

gatewayDetailsMessage: "details",

579+

healthOk: false,

580+

});

581+582+

expect(readGatewayRestartHandoffSync).toHaveBeenCalled();

583+

expect(healthCommand).toHaveBeenCalledOnce();

584+

expect(service.restart).not.toHaveBeenCalled();

585+

expect(note).toHaveBeenCalledWith(

586+

"Gateway is healthy after recent restart; skipping restart prompt.",

587+

"Gateway",

588+

);

589+

});

590+591+

it("prompts for restart when health probe fails despite recent restart handoff in normal doctor flow", async () => {

592+

vi.useFakeTimers();

593+

vi.setSystemTime(40_000);

594+

setPlatform("linux");

595+

const handoff = {

596+

kind: "gateway-supervisor-restart-handoff" as const,

597+

version: 1 as const,

598+

intentId: "intent-unhealthy",

599+

pid: 88_888,

600+

createdAt: 35_000,

601+

expiresAt: 95_000,

602+

reason: "gateway.restart",

603+

source: "operator-restart" as const,

604+

restartKind: "full-process" as const,

605+

supervisorMode: "systemd" as const,

606+

} satisfies GatewayRestartHandoff;

607+

readGatewayRestartHandoffSync.mockReturnValue(handoff);

608+

healthCommand.mockRejectedValueOnce(new Error("gateway closed"));

609+610+

await maybeRepairGatewayDaemon({

611+

cfg: { gateway: {} },

612+

runtime: { log: vi.fn(), error: vi.fn(), exit: vi.fn() },

613+

prompter: createPrompter(() => false),

614+

options: { deep: false },

615+

gatewayDetailsMessage: "details",

616+

healthOk: false,

617+

});

618+619+

expect(readGatewayRestartHandoffSync).toHaveBeenCalled();

620+

expect(healthCommand).toHaveBeenCalledOnce();

621+

expect(service.restart).not.toHaveBeenCalled();

622+

// The restart prompt was shown but user declined (createPrompter returned false for it).

623+

});

554624

});