fix(launchd): verify profile updater jobs by metadata#97264
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 11:51 AM ET / 15:51 UTC. Summary PR surface: Source +131, Tests +338. Total +469 across 2 files. Reproducibility: yes. Source inspection shows current main filters profile-scoped launchd updater labels before stale-job handling, and the PR body includes macOS terminal proof showing a metadata-confirmed updater reported while a gateway-shaped control is ignored. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the metadata-gated shared launchd classifier after maintainer review, preserving gateway false-positive protection while fixing the profile-scoped updater loop. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main filters profile-scoped launchd updater labels before stale-job handling, and the PR body includes macOS terminal proof showing a metadata-confirmed updater reported while a gateway-shaped control is ignored. Is this the best way to solve the issue? Yes. The shared launchd scanner and disable helper are the right owner boundary because update cleanup, deep status, and doctor diagnostics consume the same stale-job classifier. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ef53c20497e1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +131, Tests +338. Total +469 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
|
* fix(launchd): verify profile updater jobs by metadata * fix(launchd): bind updater proof to job metadata --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
* fix(launchd): verify profile updater jobs by metadata * fix(launchd): bind updater proof to job metadata --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
A macOS update handoff can leave behind a profile-scoped launchd label like
ai.openclaw.<profile>.update.<timestamp>, which can keep rerunningopenclaw update --yesafter the gateway is already healthy.PR #96924 was closed because a label-only matcher could also classify a legitimate gateway profile whose name contains
.update.<timestamp>. This replacement keeps the bug fix but removes that false-positive path.Why This Change Was Made
Profile-scoped update labels are now treated as candidates only. Before stale-job reporting or disabling, OpenClaw confirms the launchd job through metadata:
OPENCLAW_UPDATE_RUN_HANDOFF=1in the LaunchAgent environment, orProgramArgumentsthat look like an OpenClaw update command withupdate --yes, and not a gateway command.Legacy
ai.openclaw.update.*andai.openclaw.manual-update.<digits>behavior remains unchanged. The scanner process environment marker is intentionally not trusted for other profile-scoped labels.User Impact
OpenClaw can detect and disable the stuck profile-scoped updater loop, while
status/doctorwill not recommend disabling gateway jobs whose profile names happen to look update-shaped.Evidence
pnpm exec oxfmt --check src/daemon/launchd.ts src/daemon/launchd.test.tsnode scripts/run-vitest.mjs src/daemon/launchd.test.ts-> 94 passednode scripts/run-oxlint.mjs src/daemon/launchd.ts src/daemon/launchd.test.tspnpm tsgo:corepnpm tsgo:core:testgit diff --checkmacOS launchd behavior proof
Ran from this branch on macOS with two temporary LaunchAgents under
gui/501, both created withRunAtLoad=falseand removed immediately after capture. The positive control used profile-scoped updater metadata; the negative control used a gateway command under a label that still matchesai.openclaw.<profile>.update.<timestamp>.