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

推荐订阅源

Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
宝玉的分享
宝玉的分享
量子位
Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
J
Java Code Geeks
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
S
SegmentFault 最新的问题
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 【当耐特】
小众软件
小众软件
The Cloudflare Blog
Y
Y Combinator Blog
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
IT之家
IT之家

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: repair stale gateway service on start · openclaw/ope...
steipete · 2026-05-03 · via Recent Commits to openclaw:main

@@ -5,6 +5,7 @@ import { formatConfigIssueLines } from "../../config/issue-format.js";

55

import { resolveIsNixMode } from "../../config/paths.js";

66

import { checkTokenDrift } from "../../daemon/service-audit.js";

77

import type { GatewayServiceRestartResult } from "../../daemon/service-types.js";

8+

import type { GatewayServiceStartRepairIssue, GatewayServiceState } from "../../daemon/service.js";

89

import { describeGatewayServiceRestart, startGatewayService } from "../../daemon/service.js";

910

import type { GatewayService } from "../../daemon/service.js";

1011

import { renderSystemdUnavailableHints } from "../../daemon/systemd-hints.js";

@@ -16,6 +17,7 @@ import {

1617

} from "../../infra/restart.js";

1718

import { isWSL } from "../../infra/wsl.js";

1819

import { defaultRuntime } from "../../runtime.js";

20+

import { formatCliCommand } from "../command-format.js";

1921

import { resolveGatewayTokenForDriftCheck } from "./gateway-token-drift.js";

2022

import {

2123

buildDaemonServiceSnapshot,

@@ -48,6 +50,11 @@ type ServiceRecoveryContext = {

4850

fail: (message: string, hints?: string[]) => void;

4951

};

505253+

type ServiceStartRepairContext = ServiceRecoveryContext & {

54+

state: GatewayServiceState;

55+

issues: GatewayServiceStartRepairIssue[];

56+

};

57+5158

async function maybeAugmentSystemdHints(hints: string[]): Promise<string[]> {

5259

if (process.platform !== "linux") {

5360

return hints;

@@ -221,6 +228,7 @@ export async function runServiceStart(params: {

221228

renderStartHints: () => string[];

222229

opts?: DaemonLifecycleOptions;

223230

onNotLoaded?: (ctx: ServiceRecoveryContext) => Promise<ServiceRecoveryResult | null>;

231+

repairLoadedService?: (ctx: ServiceStartRepairContext) => Promise<ServiceRecoveryResult | null>;

224232

}) {

225233

const json = Boolean(params.opts?.json);

226234

const { stdout, emit, fail } = createDaemonActionContext({ action: "start", json });

@@ -298,6 +306,41 @@ export async function runServiceStart(params: {

298306

});

299307

return;

300308

}

309+

if (startResult.outcome === "repair-required") {

310+

try {

311+

const handled = await params.repairLoadedService?.({

312+

json,

313+

stdout,

314+

fail,

315+

state: startResult.state,

316+

issues: startResult.issues,

317+

});

318+

if (handled) {

319+

emit({

320+

ok: true,

321+

result: handled.result,

322+

message: handled.message,

323+

warnings: handled.warnings,

324+

service: buildDaemonServiceSnapshot(params.service, handled.loaded ?? true),

325+

});

326+

if (!json && handled.message) {

327+

defaultRuntime.log(handled.message);

328+

}

329+

return;

330+

}

331+

} catch (err) {

332+

const hints = params.renderStartHints();

333+

fail(`${params.serviceNoun} repair failed: ${String(err)}`, hints);

334+

return;

335+

}

336+

fail(

337+

`${params.serviceNoun} service needs repair before it can start: ${startResult.issues

338+

.map((issue) => issue.message)

339+

.join("; ")}`,

340+

[formatCliCommand("openclaw gateway install --force")],

341+

);

342+

return;

343+

}

301344

emit({

302345

ok: true,

303346

result: "started",