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

推荐订阅源

量子位
D
Docker
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
Vercel News
Vercel News
美团技术团队
博客园 - 叶小钗
I
InfoQ
Jina AI
Jina AI
博客园 - 司徒正美
雷峰网
雷峰网
B
Blog
Y
Y Combinator Blog
A
About on SuperTechFans
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recent Announcements
Recent Announcements
V
V2EX
N
Netflix TechBlog - Medium

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(gateway): harden launchd reload handoff race recovery...
NianJiuZst · 2026-05-22 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -35,6 +35,7 @@ Docs: https://docs.openclaw.ai

3535
3636

### Fixes

3737
38+

- Gateway/LaunchAgent: wait for launchd reload bootout to finish and fall back to kickstart when bootstrap races, so reload handoff does not leave the service deregistered. Fixes #84630. (#84641) Thanks @NianJiuZst.

3839

- CLI/update: preserve managed Gateway service environment during package cutovers so macOS LaunchAgent repair/restart reads the pre-update service state instead of caller shell state. (#83026)

3940

- Agents/providers: honor per-model `api` and `baseUrl` overrides in custom provider auth hooks and transport selection. Fixes #80487. (#80488) Thanks @huveewomg.

4041

- Gateway/restart: eager-load the lifecycle runtime before in-place upgrade signal handling so package replacement does not deadlock restart imports. (#84890) Thanks @myps6415.

Original file line numberDiff line numberDiff line change

@@ -94,7 +94,7 @@ describe("scheduleDetachedLaunchdRestartHandoff", () => {

9494

expect(args[1]).not.toContain('basename "$service_target"');

9595

});

9696
97-

it("bootouts and bootstraps for reload mode", () => {

97+

it("polls after bootout and falls back to kickstart on bootstrap failure for reload mode", () => {

9898

spawnMock.mockReturnValue({ pid: 4242, unref: unrefMock });

9999
100100

scheduleDetachedLaunchdRestartHandoff({

@@ -110,8 +110,12 @@ describe("scheduleDetachedLaunchdRestartHandoff", () => {

110110

expect(args[1]).toContain("openclaw restart attempt source=launchd-handoff mode=reload");

111111

expect(args[1]).toContain('launchctl enable "$service_target"');

112112

expect(args[1]).toContain('launchctl bootout "$service_target"');

113+

// polls until launchd finishes the async unload before re-bootstrapping

114+

expect(args[1]).toContain("bootout_wait_count=");

115+

expect(args[1]).toContain('if ! launchctl print "$service_target" >/dev/null 2>&1; then');

113116

expect(args[1]).toContain('if launchctl bootstrap "$domain" "$plist_path"; then');

114-

expect(args[1]).not.toContain('launchctl kickstart -k "$service_target"');

117+

// fallback: kickstart -k on bootstrap failure so service isn't left deregistered

118+

expect(args[1]).toContain('launchctl kickstart -k "$service_target"');

115119

});

116120
117121

it("sanitizes restart helper environment overrides before spawning", () => {

Original file line numberDiff line numberDiff line change

@@ -153,17 +153,33 @@ exit "$status"

153153

if (mode === "reload") {

154154

// Reloading is required after plist content changes; kickstart alone keeps

155155

// launchd's already-loaded stdout/stderr/stdin paths.

156+

// After bootout we poll until launchd finishes the async unload before

157+

// re-bootstrapping to avoid EIO (Bootstrap failed: 5) from the race.

158+

// If bootstrap still fails, kickstart -k as a fallback to keep the service

159+

// alive rather than leaving it deregistered.

160+

const bootoutWaitLoop = `bootout_wait_count="${START_AFTER_EXIT_PRINT_RETRY_COUNT}"

161+

while [ "$bootout_wait_count" -gt 0 ]; do

162+

if ! launchctl print "$service_target" >/dev/null 2>&1; then

163+

break

164+

fi

165+

bootout_wait_count=$((bootout_wait_count - 1))

166+

sleep ${START_AFTER_EXIT_PRINT_RETRY_DELAY_SECONDS}

167+

done

168+

`;

156169

return `service_target="$1"

157170

domain="$2"

158171

plist_path="$3"

159172

${waitForCallerPid}

160173

status=0

161174

launchctl enable "$service_target"

162175

launchctl bootout "$service_target" >/dev/null 2>&1 || true

176+

${bootoutWaitLoop}

163177

if launchctl bootstrap "$domain" "$plist_path"; then

164178

status=0

165179

else

166180

status=$?

181+

launchctl kickstart -k "$service_target"

182+

status=$?

167183

fi

168184

if [ "$status" -eq 0 ]; then

169185

printf '[%s] openclaw restart done source=launchd-handoff mode=${mode}\\n' "$(date -u +%FT%TZ)" >&2