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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
IT之家
IT之家
Google DeepMind News
Google DeepMind News
D
Docker
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 【当耐特】
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
月光博客
月光博客
宝玉的分享
宝玉的分享
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

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: persist gateway service wrappers · openclaw/openclaw...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -10,6 +10,7 @@ import { resolveFutureConfigActionBlock } from "../../config/future-version-guar

1010

import { readConfigFileSnapshotForWrite } from "../../config/io.js";

1111

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

1212

import type { OpenClawConfig } from "../../config/types.js";

13+

import { OPENCLAW_WRAPPER_ENV_KEY, resolveOpenClawWrapperPath } from "../../daemon/program-args.js";

1314

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

1415

import { resolveGatewayService } from "../../daemon/service.js";

1516

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

@@ -44,6 +45,13 @@ function mergeInstallInvocationEnv(params: {

4445

continue;

4546

}

4647

const upper = key.toUpperCase();

48+

if (upper === OPENCLAW_WRAPPER_ENV_KEY) {

49+

const value = rawValue.trim();

50+

if (value) {

51+

preservedServiceEnv[OPENCLAW_WRAPPER_ENV_KEY] = value;

52+

}

53+

continue;

54+

}

4755

if (

4856

upper === "HOME" ||

4957

upper === "PATH" ||

@@ -99,6 +107,19 @@ export async function runDaemonInstall(opts: DaemonInstallOptions) {

99107

fail('Invalid --runtime (use "node" or "bun")');

100108

return;

101109

}

110+

let wrapperPath: string | undefined;

111+

if (opts.wrapper !== undefined) {

112+

try {

113+

wrapperPath = await resolveOpenClawWrapperPath(opts.wrapper);

114+

if (!wrapperPath) {

115+

fail("Invalid --wrapper");

116+

return;

117+

}

118+

} catch (err) {

119+

fail(`Invalid --wrapper: ${String(err)}`);

120+

return;

121+

}

122+

}

102123103124

const service = resolveGatewayService();

104125

let loaded = false;

@@ -122,6 +143,14 @@ export async function runDaemonInstall(opts: DaemonInstallOptions) {

122143

env: process.env,

123144

existingServiceEnv,

124145

});

146+

if (!wrapperPath) {

147+

try {

148+

wrapperPath = await resolveOpenClawWrapperPath(installEnv[OPENCLAW_WRAPPER_ENV_KEY]);

149+

} catch (err) {

150+

fail(`Invalid ${OPENCLAW_WRAPPER_ENV_KEY}: ${String(err)}`);

151+

return;

152+

}

153+

}

125154

if (loaded) {

126155

if (!opts.force) {

127156

const autoRefreshMessage = await getGatewayServiceAutoRefreshMessage({

@@ -130,6 +159,7 @@ export async function runDaemonInstall(opts: DaemonInstallOptions) {

130159

installEnv,

131160

port,

132161

runtime: runtimeRaw,

162+

wrapperPath,

133163

existingEnvironment: existingServiceEnv,

134164

config: cfg,

135165

});

@@ -182,6 +212,7 @@ export async function runDaemonInstall(opts: DaemonInstallOptions) {

182212

env: installEnv,

183213

port,

184214

runtime: runtimeRaw,

215+

wrapperPath,

185216

existingEnvironment: existingServiceEnv,

186217

warn: (message) => {

187218

if (json) {

@@ -217,6 +248,7 @@ async function getGatewayServiceAutoRefreshMessage(params: {

217248

installEnv: NodeJS.ProcessEnv;

218249

port: number;

219250

runtime: GatewayDaemonRuntime;

251+

wrapperPath?: string;

220252

existingEnvironment?: Record<string, string | undefined>;

221253

config: OpenClawConfig;

222254

}): Promise<string | undefined> {

@@ -231,6 +263,7 @@ async function getGatewayServiceAutoRefreshMessage(params: {

231263

env: params.installEnv,

232264

port: params.port,

233265

runtime: params.runtime,

266+

wrapperPath: params.wrapperPath,

234267

existingEnvironment: params.existingEnvironment,

235268

warn: () => undefined,

236269

config: params.config,

@@ -242,6 +275,26 @@ async function getGatewayServiceAutoRefreshMessage(params: {

242275

return "Gateway service OPENCLAW_GATEWAY_TOKEN differs from the current install plan; refreshing the install.";

243276

}

244277

}

278+

const wrapperRequested = Boolean(

279+

params.wrapperPath || normalizeOptionalString(params.installEnv[OPENCLAW_WRAPPER_ENV_KEY]),

280+

);

281+

if (wrapperRequested) {

282+

const plannedInstall = await buildGatewayInstallPlan({

283+

env: params.installEnv,

284+

port: params.port,

285+

runtime: params.runtime,

286+

wrapperPath: params.wrapperPath,

287+

existingEnvironment: params.existingEnvironment,

288+

warn: () => undefined,

289+

config: params.config,

290+

});

291+

if (

292+

plannedInstall.programArguments.join("\u0000") !==

293+

currentCommand.programArguments.join("\u0000")

294+

) {

295+

return "Gateway service command differs from the current wrapper install plan; refreshing the install.";

296+

}

297+

}

245298

const currentExecPath = currentCommand.programArguments[0]?.trim();

246299

if (!currentExecPath) {

247300

return undefined;