fix: harden gateway launchd and configure sections#82844
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Real behavior proof Next step before merge Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c4f20b656eac. |
|
Proof before landing:
Known gap: no live launchctl install/restart smoke after the final rebase; covered by launchd unit coverage and CI. |
Summary
~/.openclaw/logswas symlinked/external, and loaded old plists were not reliably reloaded after generated plist changes.~/Library/Logs/openclaw, suppress stderr, attach stdin to/dev/null, and force a launchd reload when an installed plist is rewritten; configure section-only flows skip unrelated Gateway prompts/probes/UI asset work.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
openclaw configure --section modelblocking on an unrelated Gateway selection prompt.OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/daemon/restart-logs.test.ts src/daemon/launchd.test.ts src/daemon/launchd-restart-handoff.test.ts src/daemon/diagnostics.test.ts src/daemon/runtime-hints.test.ts src/daemon/runtime-hints.windows-paths.test.ts src/commands/configure.wizard.test.ts src/cli/daemon-cli/status.print.test.ts src/commands/status-all/diagnosis.test.ts;pnpm exec oxfmt --check --threads=1 ...;git diff --check origin/main...HEAD;node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox --shell -- "pnpm check:changed"before the final rebase.tbx_01krsvxcaj5v7a16p6jne1a2sa, Actions run25979043487, exit 0 before the final changelog-only rebase; post-rebasegit diff --check origin/main...HEADpassed./dev/nullstdin and stable macOS log paths, stale loaded plists reload instead of kickstarting with old stdio paths, Darwin diagnostics/status read the LaunchAgent stdout path only, and non-gateway configure section flows enter their target setup without Gateway prompt/probe side effects.Root Cause (if applicable)
Regression Test Plan (if applicable)
src/daemon/launchd.test.ts,src/daemon/restart-logs.test.ts,src/daemon/diagnostics.test.ts,src/daemon/runtime-hints.test.ts,src/commands/configure.wizard.test.ts,src/cli/daemon-cli/status.print.test.ts,src/commands/status-all/diagnosis.test.ts./dev/null, rewritten plists reload before restart, preflight failures do not strand pending reloads, and non-gateway configure sections do not prompt/probe/build Gateway UI assets.User-visible / Behavior Changes
~/Library/Logs/openclaw/gateway.logand profile-specificgateway-<profile>.lognames.openclaw configure --section modeland other non-gateway section-only flows skip unrelated Gateway setup prompts/probes.Diagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
Steps
configure --section model, existing remote config, and channel/web section flows.Expected
Actual
Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
OPENCLAW_LOG_PREFIXnode-service compatibility, failed port-busy preflight before plist rewrite, status missing-unit/missing-supervision hints.Review Conversations
Compatibility / Migration
Risks and Mitigations