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

推荐订阅源

IT之家
IT之家
腾讯CDC
博客园 - Franky
S
SegmentFault 最新的问题
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks
Y
Y Combinator Blog
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
I
InfoQ
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
B
Blog RSS Feed
博客园 - 叶小钗
博客园_首页
有赞技术团队
有赞技术团队
雷峰网
雷峰网
量子位
小众软件
小众软件
月光博客
月光博客
U
Unit 42
D
DataBreaches.Net

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(mac): reject unknown restart options · openclaw/openc...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -132,13 +132,60 @@ function runCanonicalizeAppBundle(appBundle: string) {

132132

};

133133

}

134134
135+

function runRestartArgParser(...args: string[]) {

136+

const root = mkdtempSync(join(tmpdir(), "openclaw-restart-mac-test-"));

137+

tempRoots.push(root);

138+
139+

const script = readFileSync(restartScriptPath, "utf8");

140+

const parserBlock = script.slice(

141+

script.indexOf('for arg in "$@"; do'),

142+

script.indexOf('if [[ "$NO_SIGN" -eq 1 && "$SIGN" -eq 1 ]]'),

143+

);

144+

const harnessPath = join(root, "arg-parser-harness.sh");

145+

writeFileSync(

146+

harnessPath,

147+

[

148+

"#!/usr/bin/env bash",

149+

"set -euo pipefail",

150+

"WAIT_FOR_LOCK=0",

151+

"NO_SIGN=0",

152+

"SIGN=0",

153+

"AUTO_DETECT_SIGNING=1",

154+

"ATTACH_ONLY=1",

155+

'log() { printf "%s\\n" "$*"; }',

156+

'fail() { printf "ERROR: %s\\n" "$*" >&2; exit 1; }',

157+

parserBlock,

158+

'printf "wait=%s no_sign=%s sign=%s attach_only=%s\\n" "$WAIT_FOR_LOCK" "$NO_SIGN" "$SIGN" "$ATTACH_ONLY"',

159+

].join("\n"),

160+

);

161+

chmodSync(harnessPath, 0o755);

162+
163+

return spawnSync("bash", [harnessPath, ...args], { encoding: "utf8" });

164+

}

165+
135166

afterEach(() => {

136167

for (const root of tempRoots.splice(0)) {

137168

rmSync(root, { force: true, recursive: true });

138169

}

139170

});

140171
141172

describe("scripts/restart-mac.sh", () => {

173+

it("rejects unknown restart options before side effects", () => {

174+

const result = runRestartArgParser("--wat");

175+
176+

expect(result.status).toBe(1);

177+

expect(result.stdout).toBe("");

178+

expect(result.stderr.trim()).toBe("ERROR: Unknown restart option: --wat");

179+

});

180+
181+

it("parses restart mode flags before side effects", () => {

182+

const result = runRestartArgParser("--wait", "--no-sign", "--no-attach-only");

183+
184+

expect(result.status).toBe(0);

185+

expect(result.stdout.trim()).toBe("wait=1 no_sign=1 sign=0 attach_only=0");

186+

expect(result.stderr).toBe("");

187+

});

188+
142189

it("fails the gateway verification when lsof finds no listener", () => {

143190

const result = runGatewayPortCheck("#!/usr/bin/env bash\nexit 1\n");

144191