Skip to content

fix: handle endpoint-protected plists during Gateway activation - #149307

Merged
Patrick-Erichsen merged 5 commits into
openclaw:mainfrom
PollyBot13:fix/launchdaemon-actual-read
Sep 23, 2026
Merged

Patrick-Erichsen merged 5 commits into
openclaw:mainfrom
PollyBot13:fix/launchdaemon-actual-read

Conversation

@PollyBot13

@PollyBot13 PollyBot13 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139813. Preserves the runtime decoder from #151432 and the updater simplification from #155355.

What Problem This Solves

macOS detached Gateway restarts and the standalone source updater can refuse activation when endpoint protection denies pathname-based plist parsing, even when the definition is readable and belongs to another service.

Why This Change Was Made

The detached ownership probe retains its pathname fast path, then reads a bounded regular-file snapshot through macOS system Perl and asks the native parser to inspect those bytes. The standalone updater reads one bounded snapshot and extracts only the top-level string Label, avoiding whole-plist JSON conversion. Both paths classify actual read errors and reject incomplete native commands. Shell lint fallback is accepted only after the parser's documented ordinary failure status.

Same-label owners, malformed readable definitions, unrelated I/O errors, and interrupted queries still block activation. Main's shared runtime decoder remains canonical. No configuration, schema, protocol, or installed dependency changes. Production/tooling net +108 supplies the bounded package-independent readers and completion/error classification; the original duplicate runtime parser and extra execution plumbing are removed.

User Impact

Readable foreign definitions and actual permission-denied reads follow the existing non-owner policy. An unloaded same-label definition hidden by read denial remains the accepted visibility limitation. Missing system Perl refuses unverifiable detached activation. This does not change endpoint-protection policy or suppress alerts. Already-generated scripts retain their original bytes.

Main retired the updater's generated restart helper in #155355. That deletion is preserved; the real SIGTERM/no-activation regression now exercises the surviving daemon handoff. Managed package updates use the target installation's Gateway CLI.

Evidence

Candidate: 48f75ad09a582c72d621e5dce30617a3acb560ca, rebased onto d88a97ad748. Both changed production blobs are identical to the earlier proof build.

  • Eight regressions fail on unchanged main, and five interrupted-parser regressions fail on the first reconciled candidate. They pass after the owner repair.
  • 212 original focused tests passed. After adopting main's retired-helper change, all 208 tests in five current owner/caller suites pass, including 142 updater service integration cases; the canonical build, service type graph, formatting, and fresh review pass.
  • The migrated real generated-handoff SIGTERM case fails before repair with exit 0; afterward it exits 78, logs refusal, and makes no activation call. All 14 handoff sibling tests pass.
  • Real macOS filesystem, Perl, and Apple plutil proof shows foreign XML/binary pathname denial and actual read denial changing from exit 78/no activation to exit 0/activation. Same-label and malformed definitions remain exit 78/no activation. Ten fixture byte hashes remained unchanged.
  • A real Node timeout probe returned exit zero with ETIMEDOUT; the updater now rejects that incomplete result. Native shell fixtures skip on Linux. Focused native tests used Node 24.19.0.
  • Fresh autoreviews found no actionable P0 findings; independent owner/caller/sibling/native-contract inspection also found no outstanding code blocker.

Published-driver upgrade proof: registry-verified npm 2026.9.5 completed an installed-service update into the f116 candidate package. Detached driver/finalizer exited 0; Doctor, target-CLI install, native bootstrap, RPC, readiness, settled state, and exact build checks passed with real Gateway processes and a strict launchctl simulator. The retained old script hash remained unchanged. This package proof predates the subsequent main rebases and updater-helper retirement; it is historical package evidence, not a fresh run of the complete rebased package. The successful run used install followed by healthy verification, with no separate target-CLI restart invocation; main retains that exercised path. Actual flinco/Elastic-host recovery and alerts remain unverified; issue139813 remains open for that follow-up.

CI-exposed test repairs, each recorded with before/after evidence:

Final CI on exact head48f75ad completed successfully: all161 selected jobs passed or skipped, including openclaw/ci-gate. The pre-rebase head88cd92 also completed all selected CI jobs successfully, including the formerly failing catalog, cursor, and task-list shards. The earlier unexplained task-list count failure remains a named uncertainty, not a claimed fix; its assertions and timeout remain unchanged. Initial CI diagnostics and other named follow-ups are retained.

Final delta: production/tooling +123/-15 (net +108); tests/test-support +576/-174 (net +402, including mechanical moves); docs +2. AI-assisted contributor implementation and maintainer reconciliation; original author credit preserved.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: L labels Sep 15, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 11:31 PM ET / September 23, 2026, 03:31 UTC (Revision 11).

ClawSweeper review

What this changes

The PR repairs macOS Gateway activation around endpoint-protected service definitions and fixes Gateway test teardown and synchronization.

Merge readiness

✅ Ready for maintainer review

This remains a useful, well-supported fix that current main does not fully provide. The earlier extraction finding is resolved, and no blocking introduced defect remains.

Priority: P1
Reviewed head: 48f75ad09a582c72d621e5dce30617a3acb560ca

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused production repair with strong native boundary evidence, resolved prior findings, and explained test-fixture repairs.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded macOS execution exercises the changed reader and generated handoff with real filesystem, Perl, and Apple plutil behavior, including recovery and zero-activation refusal controls. Both production blobs match the proof build. Published-driver upgrade evidence remains scoped to its historical package and preserved installation path; actual EDR-host recovery is not claimed. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded macOS execution exercises the changed reader and generated handoff with real filesystem, Perl, and Apple plutil behavior, including recovery and zero-activation refusal controls. Both production blobs match the proof build. Published-driver upgrade evidence remains scoped to its historical package and preserved installation path; actual EDR-host recovery is not claimed. No stored-data contract changes.
Evidence reviewed 10 items Pinned patch and merge ownership: Reviewed the merge-base-to-head introduced changes. The inspected test merge records the supplied base followed by the exact PR head; its changed paths match the introduced surface, without the base-only updater and locale changes.
Current main still needs the remaining repair: Main retains pathname-only detached parsing and the standalone updater's pathname JSON conversion. The branch adds captured-byte handling while preserving the runtime decoder already landed through #151432.
Latest supplied release remains affected: The v2026.9.5 source still uses pathname extraction in the detached helper and access-check fallback in the runtime reader. Local historical blob access failed, so the release source was inspected through GitHub's contents API.
Findings None None.
Security None None.

How this fits together

Before activating a user Gateway service, OpenClaw checks whether a system service already owns its label. The detached restart helper and standalone updater inspect installed service definitions and either permit activation or report a conflict.

flowchart TD
  A[Gateway restart or update] --> B[System ownership check]
  C[Loaded system services] --> B
  D[Installed service definitions] --> E[Read bytes and parse label]
  E --> B
  B -->|Absent| F[Activate user Gateway]
  B -->|Conflict or unverifiable| G[Refuse and report reason]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +61, Tests +399, Docs +2, Other +50. Total +512 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 3 83 22 +61
Tests 11 553 154 +399
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 63 13 +50
Total 16 701 189 +512

Review metrics

Metric Value Why it matters
Production versus test growth Production/tooling net +108; tests/test-support net +402 Production growth supplies bounded package-independent readers and completion checks; test growth includes mechanical helper moves and demonstrated regressions.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #139813
Summary: This PR addresses the remaining detached-restart and standalone-updater paths of the reported activation failure; affected-host validation remains with the open issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep native structural parsing and actual-read error classification consistent across activation paths, preserving exact-label conflicts and the documented unreadable-file policy.

Do we have a high-confidence way to reproduce the issue?

Yes, at the source boundary: on current main, readable foreign definitions whose pathname parsing fails still block detached activation. Recorded macOS before/after evidence exercises that path; this review did not execute it.

Is this the best way to solve the issue?

Yes. The patch repairs the remaining package-independent readers while retaining main's shared runtime decoder, exact-label checks, and activation refusal for malformed or unverifiable input.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e072e5af596b.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The linked report establishes prolonged macOS Gateway outages when protected service definitions block restart and recovery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded macOS execution exercises the changed reader and generated handoff with real filesystem, Perl, and Apple plutil behavior, including recovery and zero-activation refusal controls. Both production blobs match the proof build. Published-driver upgrade evidence remains scoped to its historical package and preserved installation path; actual EDR-host recovery is not claimed. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded macOS execution exercises the changed reader and generated handoff with real filesystem, Perl, and Apple plutil behavior, including recovery and zero-activation refusal controls. Both production blobs match the proof build. Published-driver upgrade evidence remains scoped to its historical package and preserved installation path; actual EDR-host recovery is not claimed. No stored-data contract changes.

Evidence

What I checked:

  • Pinned patch and merge ownership: Reviewed the merge-base-to-head introduced changes. The inspected test merge records the supplied base followed by the exact PR head; its changed paths match the introduced surface, without the base-only updater and locale changes. (54bddfa5f6c0)
  • Current main still needs the remaining repair: Main retains pathname-only detached parsing and the standalone updater's pathname JSON conversion. The branch adds captured-byte handling while preserving the runtime decoder already landed through fix: discover macOS Gateways from native service definitions #151432. (src/daemon/launchd-system.ts:88, e072e5af596b)
  • Latest supplied release remains affected: The v2026.9.5 source still uses pathname extraction in the detached helper and access-check fallback in the runtime reader. Local historical blob access failed, so the release source was inspected through GitHub's contents API. (src/daemon/launchd-system.ts, ec9c1a13db89)
  • Previous blocking finding resolved: Both shell extraction paths preserve command status and permit lint fallback only after ordinary status 1. The surviving daemon handoff regression checks actual SIGTERM, exit 78, a refusal log, and zero activation calls; the discussion records its failing-before and passing-after results. (src/daemon/launchd-system.ts:152, 48f75ad09a58)
  • Native proof remains bound to the production source: GitHub contents queries for proof build f1161d2b840887e266db6c60212108e56fb82602 returned production blob IDs cc2324aef0d9049dc45da92c8fb80ea1255e1b6a and f73ee62e0baba6ae95886ca5e0d942d12012575c, exactly matching the reviewed head. Captured discussion reports real macOS filesystem, Perl, and Apple plutil execution: foreign definitions recover, while same-label and malformed definitions remain blocked. Service commands were simulated. (src/daemon/launchd-system.ts:103, 48f75ad09a58)
  • Published-driver upgrade evidence and limits: The captured proof at fix: handle endpoint-protected plists during Gateway activation #149307 (comment) records published 2026.9.5 updating into the f116 package with real Gateway processes, successful Doctor/install/readiness verification, and unchanged retained script bytes. It used a strict launchctl simulator and predates subsequent rebases. The exercised install-then-healthy-verification path survives main's helper retirement; this is not a fresh complete-package run or affected-EDR-host recovery proof. (f1161d2b8408)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed September 22, 2026, 7:55 AM ET / 11:55 UTC (Revision 3) sha unknown :: blocked before merge. :: none
  • reviewed 2026-09-23T00:15:37.762Z sha c38474eb42f4bc4213f44d84ff6d2f7a59793fb6 :: blocked before merge. :: [P1] Reject interrupted Label extraction before accepting successful lint
  • reviewed 2026-09-23T01:06:52.205Z sha 9ea5aafbfb77ee64d2859d387e45a64d69ce7709 :: blocked before merge. :: none
  • reviewed 2026-09-23T01:23:10.127Z sha b3873a292b7893a107e416c0a55ae6fd6ac29e3b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T01:55:24.685Z sha 8e64fec7be61b84deced3b90a5de002f0eb2ad4a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T02:05:09.663Z sha d17af403d6da13150eaed90519a79f5428becbf2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T02:29:39.106Z sha 88cd92dc6afd3f2bb4a41f958d569917e4d5ed6a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T03:00:50.481Z sha 48f75ad :: needs maintainer review before merge. :: none

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Reviewed and reconciled against current main in c38474eb42f4, preserving @PollyBot13's author credit.

Both ClawSweeper integration items and the rank-up move are addressed: main's shared runtime decoder stays intact; the obsolete parallel decoder and exec-input plumbing are removed. Detached restarts and the package-independent updater now classify actual bounded reads and preserve structural, exact-string ownership. Review also caught and repaired valid date/data metadata rejection, newline-label conflation, and interrupted native queries (including exit-zero timeouts).

Validation on macOS arm64, Node 24.19.0:

  • 207 focused tests pass across the runtime/native decoder, detached shell, standalone updater, restart handoff, and both restart-helper callers. Eight regression cases fail against the unchanged main baseline for the intended reasons.
  • Real generated restart-script execution, real filesystem reads, system Perl, and Apple plutil: foreign XML/binary with injected pathname denial and actual read denial change from exit 78/no activation to exit 0/activation requested. Same-label ownership and malformed bytes stay blocked. All ten fixture hashes are unchanged. Service commands are simulated; no live service was altered.
  • Changed-surface guards, formatting, all typecheck shards, dead-code checks, full lint, targeted root-test lint, and import-cycle checks pass. Full lint used a separate physical checkout with its own install after the nested worktree hit the dependency-isolation guard.
  • Fresh Codex autoreview reports no actionable P0 findings; independent source review covered the owner, callers, siblings, historical fixes, and native dependency contracts.

Production/tooling: +120/-14, net +106; tests: +297/-20, net +277; docs: +2. The production increase supplies the bounded package-independent reader and actual read/completion classification. The updater uses one snapshot and the runtime retains its existing shared decoder. No config, protocol, or database surface changes.

Actual flinco/Elastic-host recovery, endpoint alerts, a full package swap, and an existing live-service upgrade remain unverified because no affected host was available. The controlled native proof is scoped to the changed boundary; #139813 remains open for affected-host validation. Existing pre-generated restart scripts are unchanged.

Exact-head hosted CI is pending. Native prepare/merge will run only after its required gates pass.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 23, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

CI attempt 1 found three failed shards outside the changed paths:

  • Native relay shard: the token-target assertion received a bridge timeout instead of target mismatch. Its existing 500 ms deadline includes cold SQLite worker lookup and the HTTP request. The failing test and owner modules are unchanged from the PR parent and inspected main. The exact assertion passes locally, and the complete file passes all 123 tests in its original order.

  • Gateway methods shard: the isolated lane completed all 539 tests, then agent.test.ts failed singleton teardown with SQLite disk I/O error. Its fixtures, worker lifecycle, and runner are unchanged by this PR. The complete agent file passes locally, including teardown (358 tests). The log lacks the failing database path, so a specific teardown cause is not established.

  • Gateway chat shard: history fixture cleanup refused active native database borrowers, cascading into later fixture hooks; an orphan-recovery test separately received terminal error with its underlying warning suppressed by the fixture logger. Both complete files pass together locally (28 tests). The implicated fixture, task-store, and recovery source is unchanged from the parent; newer main projection work changes timing but does not remove this cleanup ordering.

  • The last runtime-server shard stopped emitting output at server-worker-placement-reclaim.preparation.test.ts database drainage for over six minutes. I cancelled the otherwise-finished attempt to retry its remaining work. That entire file passes locally (40 tests).

Named follow-ups: native relay token-binding test includes an unrelated cold-worker deadline; investigate temporary Gateway state deletion before SQLite worker retirement. The latter is a source-backed hypothesis, not a diagnosed cause. Additional investigations: Gateway history fixture reset before borrower release and capture orphan-recovery terminal failure diagnostics under CI load. No assertions, timeouts, or production behavior have been weakened for this PR.

Only failed/cancelled CI jobs are being retried on the unchanged reviewed head c38474eb42f4bc4213f44d84ff6d2f7a59793fb6; required exact-head CI must still pass before merge.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Addressed the ClawSweeper extraction finding in f1161d2b8408.

Both shell lint paths now require the extraction command's documented ordinary failure status (plutil: 0 success, 1 failure). The command-substitution status survives sentinel output; abnormal exits, execution failures, and signals cannot be accepted as evidence of an absent Label.

Before/after proof: four snapshot tests (exit 2, 126, 127, and actual SIGTERM) and the complete generated update-restart script all fail on the previous reviewed commit and pass after this correction. The generated script now exits 78, records the refusal, and requests zero activation. Existing foreign/non-string, exact-owner, malformed, permission-denied, and newly-loaded-owner cases continue to pass.

All 212 focused tests pass on this commit. Fresh autoreview is clean at its configured P0 scope; an independent source review found no P1/P2 defects. Production growth from this correction is two explanatory comment lines; the status checks replace existing branches.

The new native shell/generated-restart files took 23.39s wall with one worker, including cold compiler preparation; the SIGTERM handoff case took 437ms. Native parser cases skip on Linux.

The separate published-driver upgrade proof is in progress using an untouched npm 2026.9.5 installation and a package built from this exact candidate, with isolated home/state/prefix and preserved pre-generated restart-script bytes. Exact-head CI is also running again. No claim of actual endpoint-protection-host recovery is made.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: L and removed size: M labels Sep 23, 2026
@Patrick-Erichsen
Patrick-Erichsen force-pushed the fix/launchdaemon-actual-read branch from f1161d2 to 9ea5aaf Compare September 23, 2026 00:57
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Both actionable items from the latest ClawSweeper review are addressed at 9ea5aafbfb77ee64d2859d387e45a64d69ce7709.

  • Interrupted extraction: only plutil's documented failure status 1 can enter lint fallback. Five regressions fail on the earlier candidate and pass after repair, including SIGTERM in the actual generated restart script: exit 78, recorded refusal, zero activation. The final test-context correction passes type checking and both generated-script cases; 212 focused tests cover the repaired production code.
  • Published-driver upgrade: npm-published OpenClaw 2026.9.5 (ec9c1a13db89), verified against the registry archive, executed openclaw update --yes --tag=<candidate.tgz> --json with an installed, RPC-healthy fixture Gateway. Foreground exit 75 recorded managed-service-handoff-started; the detached published driver and candidate finalizer exited 0. Candidate Doctor, actual gateway install --force --port … --json --update-executor run, service restart, and post-update verification completed. The durable run finished succeeded; RPC, readyz, settled, version/build match, and service-running checks were true.

The package was built from f1161d2b8408; its production bytes are identical to final head 9ea5aafbfb77 (the only subsequent change is it.each → it.for in one test). The responding Gateway reported that exact package build ID.

Native generated-script scenario Published driver script Candidate-generated script Retained old script after update
Ordinary foreign plist activates activates activates
Foreign XML/binary; pathname parsing denied refuses, exit 78 activates, exit 0 refuses, exit 78
Same-label owner; pathname parsing denied refuses, exit 78 refuses, exit 78 refuses, exit 78
Interrupted same-label extraction refuses, exit 78 refuses, exit 78 refuses, exit 78

All 15 native cells pass; fixture bytes are unchanged. The pre-update script also retained its exact SHA-256 across the completed package swap (9d7f34042c49e2a83510905386e328ef619905135a8775b46abf854c054f4ee1). This verifies the documented limitation: an already-generated old script does not acquire the new reader during an update.

Proof boundaries: temporary HOME/account adapter and a strict launchctl simulator, real installed packages, real Gateway processes/RPC, system Perl, and Apple plutil. Absolute launchctl interception was verified in both driver children and both managed Gateway runtimes; unknown targets/paths refuse. Pathname denial and interruption were injected. Initial fixture attempts exposed an overbroad bundled-plugin disable and a custom-label mismatch; those fixtures were corrected before the final successful run. This is installed-updater and native-parser proof, not evidence from an actual Elastic/EDR-protected host or of alert suppression. Affected-host validation remains on #139813.

Final local guards, type checks, lint, dead-code scans and import-cycle checks pass. CI is still running on the exact final head: https://github.com/openclaw/openclaw/actions/runs/35804272567. The earlier unrelated CI failures remain documented follow-ups, not claimed fixed.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Published b3873a292b7893a107e416c0a55ae6fd6ac29e3b with a three-line test-only CI repair.

The exact failing job reports an active native SQLite borrower while task-history.test.ts resets its task registry. Its inner fixture cleanup runs before the context helper's afterEach; session publications can still be refreshing the live projection. The fixture now awaits the existing disposeSessionReadContexts() before registry reset, as sibling fixtures already do. That disposer stops new publications and joins accepted native reads. Current main retained the same missing ordering.

The CI log is the failing baseline. After the repair, all 69 tests in task history, the context-helper consumer suite, projection worker reads, and backfill pass. Targeted type checking, lint, formatting, and fresh autoreview pass. No production code, assertion, timeout, or retry changes.

The previously published package-upgrade and native ownership proof remains applicable: only two test files differ from packaged production commit f1161d2b8408. Final production/tooling delta stays +108; tests are now +327. Required CI is validating the corrected head before native prepare/merge.

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 23, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Resolved the repeated chat-history cursor CI teardown failure at its fixture owner.

  • Root cause: Vitest runs afterEach hooks in reverse registration order. The shared Gateway home cleanup and cursor/chat directory cleanup could close SQLite before the imported session-read helper disposed its projections. An accepted projection read still owned the native database handle.
  • Repair: move the existing projection/subscription registry and disposer into a side-effect-free test-support module. The shared home owner and both earlier directory-cleanup owners now await that disposer before closing state. Live Gateway-owned projections are unaffected.
  • Before/after: a real projection read held at the native transport boundary reproduces active native borrowers with the old cleanup order; the fixed fixture joins that read and closes the database. The captured hosted failure is run 35805594590, job 107005965978. The earlier task-history repair passed its hosted CI shard in the same run.
  • Validation: 6 focused files / 225 tests pass (195.89s wall), all core type-check graphs and formatting pass, and fresh autoreview has no actionable P0 findings; isolated-checkout lint also passes. No production changes, assertion weakening, retry, or timeout increase. Vitest 5's installed hook ordering and native read-custody implementation were directly inspected.

This test-only repair leaves the previously published native restart and installed-package upgrade evidence valid. Endpoint-protection host behavior remains the explicit follow-up on #139813.

Candidate: 58af9ce0727a35f1cdd3bd5a298665cffc169dd4.

@Patrick-Erichsen
Patrick-Erichsen force-pushed the fix/launchdaemon-actual-read branch from 58af9ce to 8e64fec Compare September 23, 2026 01:48
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Reconciled the new conflict with main's task-history repair, b21237a. The PR now retains main's disposal ordering and failure cleanup; the redundant task-history commit was dropped.

Rebased candidate: 8e64fec7be61b84deced3b90a5de002f0eb2ad4a, base 60237157f17a24a92c183d292966e726db37abf5. All 13 remaining PR file contents are byte-identical to reviewed 58af9ce0727. The combined task-history and storage-fixture tests pass on the rebased tree: 18 tests, 48.50s wall.

The prior native/package upgrade proof exercised the pre-rebase build. All PR production changes remain identical; the entire package was not rebuilt after this mechanical rebase. Exact-head CI is running for the new commit.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Resolved the file-size ratchet failure from run 35807797363/job 107012900171 without weakening its limits or reducing coverage.

  • The unchanged Gateway environment-key array moved into test-helpers.env.ts.
  • The unchanged plugin metadata fixture builder moved into plugin-metadata.test-helpers.ts; its prior call site now imports it. Both oversized files shrink.
  • Before: line-cap failures for chat-b (+4 counted lines) and the shared server helper (+2). After: the entire baseline-ratchet group passes locally—max-lines, line caps, assertion safety, config docs, and plugin inventory.
  • Validation: all 53 model tests, the affected chat reasoning/auth case, both storage-fixture tests, all four Gateway type graphs, formatting, targeted lint in the isolated checkout, and fresh autoreview pass. Builder body and environment array are byte-identical to their prior definitions.

Candidate: d17af403d6da13150eaed90519a79f5428becbf2. Production/tooling remains +123/-15 (net +108); tests/test-support +597/-187 (net +410), including mechanical moves; docs +2. The changed production blobs and prior native/package proof are unchanged.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Repaired the catalog-queue synchronization defect exposed by CI run 35808453930/job107014917851 in commit 88cd92dc6afd3f2bb4a41f958d569917e4d5ed6a.

Vitest defaults waitFor to one second. The test already owned the mutation promises, but polling could expire before those operations finished. Its cleanup then advanced the mocked diagnostic clock, recording an extra slow operation. Awaiting the real mutations under the held catalog gate preserves the ordering assertions; a deferred signal replaces polling for batch catalog entry.

Paired proof: the same temporary 1,100ms delay before the real independent mutation reproduces both CI failures before the repair and passes both afterward. The delay is absent from the patch. All 14 catalog/diagnostic tests, type checking, formatting, lint, and fresh review pass. Test-only +17/-18; production unchanged.

The separate task-list failure in job107014917828 remains unexplained: one full-file diagnostic replay produced the intended three selections, nine invalidating writes, and UNAVAILABLE response. Its exact-count and response assertions remain intact. This is a named follow-up, not a claimed fix. The new CI run is required for the concrete catalog change.

@Patrick-Erichsen
Patrick-Erichsen force-pushed the fix/launchdaemon-actual-read branch from 88cd92d to 48f75ad Compare September 23, 2026 02:53
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Rebased to resolve the actual modify/delete conflict with #155355, which retires the updater-generated restart helper. Current candidate:48f75ad09a582c72d621e5dce30617a3acb560ca; base:d88a97ad748.

The deletion is preserved. The loaded-owner and real SIGTERM/no-activation regression now uses the existing daemon handoff harness. Both changed production blobs are unchanged. Paired proof of the migrated case: old owner exits0; repaired owner exits78, logs refusal, and requests no activation. All14 handoff siblings pass. On the rebased tree, all208 tests in five ownership/current-updater suites pass (170.36s total), along with the canonical build, services type graph, formatting, isolated lint, and fresh review.

CI run35810052928 is fully green on pre-rebase88cd92, including catalog, cursor, and task-list shards. New-head CI is required for this conflict resolution. No test assertion or timeout was weakened.

Proof attribution: the historical f116 package upgrade used target-CLI install, native bootstrap, then health verification; it did not separately invoke target-CLI restart. Main preserves that exercised path. The old candidate updater-script matrix remains historical; current generated-script coverage is at the surviving daemon handoff. The complete rebased package has not been rerun through the published-driver upgrade.

@openclaw-barnacle openclaw-barnacle Bot removed the cli CLI command changes label Sep 23, 2026
@Patrick-Erichsen
Patrick-Erichsen merged commit 8a53ee3 into openclaw:main Sep 23, 2026
226 checks passed
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…claw#149307)

* fix: handle endpoint-protected plists during Gateway activation

* fix: refuse interrupted launchd label extraction

* test: drain direct chat projections before fixture teardown

* test: extract oversized gateway fixture helpers

* test: await owned catalog queue mutations

---------

Co-authored-by: Patrick Erichsen <[email protected]>
roboclaw-bot added a commit that referenced this pull request Sep 26, 2026
Backport #155433: e0dc76b
Backport #149307: 8a53ee3
Adapted backport #156584: a1107a5

Preserve authenticated pre-stop restart intent and exact cleanup receipts.
Probe protected launchd plists through the existing runtime owner. Require
a helper cleanup receipt plus unsignalled closure before replacement; same-unit
dueling installs retain system restrictions without changing global user-first policy.

143 original focused passes and 50 review-repair passes retain their bindings.
Both findings are resolved. Composed native/CLI/restart checks and frozen
guards pass; 16 native macOS cases and live system-unit/driver proof remain open.
Report credit for the system-service issue: @ion-developing.

Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: PollyBot13 <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: jalehman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants