Skip to content

refactor: share native macOS process census across runtimes - #175368

Merged
steipete merged 4 commits into
mainfrom
refactor/darwin-census-proc-safe
Oct 18, 2026
Merged

steipete merged 4 commits into
mainfrom
refactor/darwin-census-proc-safe

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem and change

macOS process inspection had separate Node and Bun implementations. Node relied on Apple's setuid ps, which cannot execute inside Seatbelt. Pin proc-safe 0.4.1 and use its native census for both runtimes. Delete the Bun/libproc census and the Darwin ps paths; retain selected-PID queries, deadlines, explicit errors, and byte-compatible normalized UTC startedAt identities.

Breaking Plugin SDK change: DarwinProcess from openclaw/plugin-sdk/process-runtime replaces uid: number with owner: "same" | "different" | "unknown". Migrate row.uid === process.getuid() to row.owner === "same"; unknown ownership is insufficient evidence. DarwinProcessInspectionError adds code: "ETIMEDOUT" | "EPERM" | "EIO". Bundled callers and documentation are migrated. No public function is added. Linux numeric UID behavior is preserved.

The separate Bun socket-shutdown and SQLite FFI bindings are outside this change.

Proof

  • Production codex sandbox: Node and Bun, main thread and real Worker, full and selected census pass (8/8 calls); the fixture verifies ps is denied. After rebasing, one Node run correctly failed closed on an incomplete topology observation (EIO); the diagnostic census had no incomplete rows and the exact rerun passed. No fallback, retry, or budget change was added.
  • Rebased focused tests: 67/67 across ownership, mapping, commands, and native inspection (4.85s wrapper). Main's new ownership fixtures retain ancestry, foreign-owner, zombie-with-flags, kernel-task, command-boundary, error, and no-shell assertions.
  • Real isolated Gateway before/after: command automation removes its root and a SIGTERM-ignoring, socket-holding child (1,426ms before; 878ms after). Dedicated state and ports; no live user Gateway touched.
  • Full build, SDK declaration generation, focused lint/types/format, dependency pins, frozen installation and npm lock mirrors validated. Existing canonical SDK metadata does not generate a public baseline for process-runtime; generated shared declarations contain the new types.
  • Final full-diff independent review is clean through P2. Core typecheck, targeted lint, all 105 npm lock mirrors, and 766 dependency pins pass on the rebased head.

CI classification

Historical CI at the prior runtime head completed with nine failed test jobs. Matching same-period main or clean-main failures established inherited attribution for held-agent layout, empty model/reasoning selections, deferred models.list, viewer replace-set timeout, memory cache overflow, Telegram model-catalog recovery, and lowercase no_reply delivery.

Composer layout-read measurement, streamed-delta batching, and young Telegram session-start conflict are unrelated flakes under the maintainer-approved Linux-equivalence classification. Their import graphs do reach changed shared modules. The Linux /proc producer never sets owner; the existing numeric UID comparisons and the systemd helper's own UID guards preserve every Linux decision, while the added owner === "different" terms are false. Clean-main probes passed these three cases. This is not a no-import-overlap claim, and failed CI is not relabeled as green. Detailed evidence: #175368 (comment).

The original cutover omissions (deleted-file wrapper inventory and incomplete test mock exports) are fixed. Three local native provisioning timeouts at the unchanged 120-second budget remain documented; no assertions or budgets were weakened. External plugin source discovery is incomplete; the breaking SDK migration is explicit release-note context.

Final head CI

CI run 39160875395, attempt 1, tests head 78b7cb7738da9dcf7a7c6e0afba52a80063f4bfe: 174 successful jobs, 22 skipped jobs, one failed test job and its failed aggregate gate. Security, build, types, lint, lock validation, and UI pass.

The sole failed test job is checks-node-changed-16: gateway-timeout-recovery-subagent.e2e.test.ts times out waiting for a terminal child's pending delivery to acquire a leasable payload. The test, registry reader and subagent owner are byte-identical to the tested main base. The run is Linux; this patch preserves Linux process decisions and proc-safe's Linux identity implementation. It is classified as an unrelated delivery failure under the maintainer-approved Linux-equivalence standard, not as a reproduced main failure. The automatic table marks it unknown because its changed-file shard has no matching main job. The native exception preserves the failed CI result and names this job and the downstream openclaw/ci-gate; no CI rerun or test-budget change is used.

@clawsweeper

clawsweeper Bot commented Oct 17, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T19:57:25.228479Z 78b7cb7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Oct 17, 2026
@socket-security

socket-security Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​openclaw/​proc-safe@​0.3.0 ⏵ 0.4.199 +24100100 +194 +1100

View full report

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This maintainer PR changes the dependency graph.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 78b7cb7738da9dcf7a7c6e0afba52a80063f4bfe
  • Maintainer: @steipete
  • Repository role: admin

These dependency graph changes were made:

  • pnpm-lock.yaml
  • pnpm-workspace.yaml
  • package.json

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: codex plugin: file-transfer size: XL labels Oct 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 283436f92e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR shares proc-safe’s native macOS process census across Node and Bun and replaces numeric Darwin ownership with relative ownership.

Example: Node inspects a Codex child inside a macOS Seatbelt sandbox that denies /bin/ps.

  • Before: Process inspection fails when Node tries to execute ps.
  • After: Native inspection returns topology and start identity without executing ps.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused native cutover with recorded product behavior and one low-impact documentation defect; failed required checks remain failed.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR records Node/Bun Seatbelt inspection and isolated Gateway descendant cleanup; source inspection confirms the exercised shared owner and unchanged final cleanup authority.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Node-based macOS process inspection cannot execute ps inside Seatbelt, blocking inspection-dependent workflows.
Reason: The maintainer chose the native cutover, which removes duplicate runtime implementations and addresses the remaining Node sandbox limitation.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the maintainer-directed native cutover is useful and coherent, with one documentation defect remaining and required checks still failing.

Priority: P2
Reviewed head: 78b7cb7738da9dcf7a7c6e0afba52a80063f4bfe

Before merge

  • Update the SDK catalog for native Node inspection (P3) - The SDK catalog still says Darwin snapshots use bounded ps under Node, although this PR removes that path. Plugin authors consulting the catalog receive an incorrect sandbox and runtime contract. Update this row to describe native inspection under both Node and Bun. This was equally visible at the earlier reviewed head; the late discovery is a review omission.

Findings

  • [P3] Update the SDK catalog for native Node inspection — docs/plugins/sdk-subpaths.md:433
Agent review details

How this fits together

The shared process inspector turns operating-system observations into topology, ownership, command, and birth-identity facts consumed by Codex containment, Doctor, and process-group cleanup.

flowchart TD
  A[macOS process facts] --> B[proc-safe native inspection]
  B --> C[Shared Darwin inspector]
  C --> D[Codex process containment]
  C --> E[Process group census]
  E --> F[Doctor and update inspection]
Loading

Technical review

Best possible solution:

Keep the shared native owner and align the SDK catalog with its documented Node and Bun behavior.

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

Current main’s Node implementation executes ps, and the supplied Seatbelt scenario exercises the denied boundary; this review ran no target code.

Is this the best way to solve the issue?

Using proc-safe through the existing Darwin inspector is the smallest coherent cutover and preserves the established cleanup owners.

Full review comments:

  • [P3] Update the SDK catalog for native Node inspection — docs/plugins/sdk-subpaths.md:433
    The SDK catalog still says Darwin snapshots use bounded ps under Node, although this PR removes that path. Plugin authors consulting the catalog receive an incorrect sandbox and runtime contract. Update this row to describe native inspection under both Node and Bun. This was equally visible at the earlier reviewed head; the late discovery is a review omission.
    Confidence: 1
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is correct
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared Darwin process inspection changes intended behavior with a stated reason (4959773: The earlier repair used Bun libproc while retaining bounded Node ps because proc-safe lacked a Darwin census API.)
  • Native ABI ownership keeps the original intent (698cac4: Typed native packages replaced application-owned ABI layouts and raw FFI.)
  • Foreign-account command uncertainty keeps the original intent (96e4061: Unreadable foreign-account arguments must not block eligible capture cleanup, while same-account or unknown ownership remains conservative.)
  • Persisted process start identities keeps the original intent (4959773: Normalized UTC lstart identities preserve registrations across runtime changes and upgrades.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm docs:check-links
  • git diff --check

What I checked:

  • Introduced cutover and current main: The pinned introduction replaces the Node ps implementation and Bun FFI census with the existing Darwin inspection owner; fetched main still contains the separate implementations. The retired wrapper entry and export-preserving ownership mock are repaired. (src/process/darwin-process-inspection.ts:103, 78b7cb7738da)
  • Authoritative native dependency contract: The patch directly imports listProcesses and ProcessSnapshot from this dependency, making its contract and repository policy applicable. At v0.4.1, native enumeration checks completeness, brackets combined facts with birth identity, and reports relative ownership; unavailable topology remains explicit. (native/src/inspect/darwin_census.rs, 90b7b6b5b715)
  • Zombie finding does not establish a Darwin regression: Apple’s authoritative ps state formatter emits Z for SZOMB and has no lowercase l modifier; that modifier belongs to the existing Linux thread-aware path. The review comment’s claimed previous Darwin Zl observation is unsupported by this implementation. (ps/print.c:473, 6bed8737a34d)
  • SDK direction and released contract: The v2026.10.4 process-runtime barrel does not export DarwinProcess. The maintainer’s discussion explicitly accepts completing the new observation contract before stable release and records incomplete external-consumer discovery: refactor: share native macOS process census across runtimes #175368 (comment). The current body and detailed SDK documentation disclose the breaking ownership change. (src/plugin-sdk/process-runtime.ts, 383c124cc32f)
  • Stale SDK catalog: The SDK catalog still describes bounded ps inspection under Node, contradicting the introduced native-only implementation and updated detailed documentation. The same wording and native mapping were present at the earlier ClawSweeper-reviewed head; REST comparison supplied the unavailable local historical revision. Public docs: docs/plugins/sdk-subpaths.md. (docs/plugins/sdk-subpaths.md:433, 78b7cb7738da)
  • Recorded behavior and cleanup boundaries: The body records Node/Bun Seatbelt observations on main and Worker threads and isolated Gateway cleanup of a signal-resistant socket-holding child. The retained Doctor composition exercises actual removal and preservation of capture files for same-account uncertainty and foreign-owned captures; start-identity formatting preserves the existing normalized UTC representation. (src/flows/doctor-plugin-source-captures.test.ts:166, 78b7cb7738da)

Likely related people:

  • Peter Steinberger: Raw commit 4959773 adds src/process/darwin-process-inspection.ts:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4959773fa7fb; files: src/process/darwin-process-inspection.ts)
  • Vincent Koc: Raw commit d1b8902 adds src/infra/openclaw-process-census.ts:69 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: d1b89023368e; files: src/infra/openclaw-process-census.ts)
  • Dallin Romney: Raw commit 88a4f54 adds src/infra/openclaw-process-census.ts:53 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 88a4f54164de; files: src/infra/openclaw-process-census.ts)

PR surface

Source -186, Tests -4, Docs +6, Config 0, Other -1. Total -185 across 21 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 6 118 304 -186
Tests 10 408 412 -4
Docs 1 12 6 +6
Config 2 13 13 0
Generated 0 0 0 0
Other 2 45 46 -1
Total 21 596 781 -185

Review metrics

Metric Value Why it matters
Production versus test changes Production +118/-304; tests and test support +408/-412 The change removes duplicated production inspection machinery while replacing implementation-specific tests with shared-contract and native-boundary coverage.

Labels

Label changes:

  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: The change repairs a limited macOS sandbox workflow and consolidates its process-inspection implementation.
  • merge-risk: 🚨 compatibility: DarwinProcess replaces uid with owner; the maintainer explicitly accepts this pre-stable SDK change and documents migration, while external-consumer discovery remains incomplete.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-17T09:17:14.644Z sha 283436f :: needs changes before merge. :: [P2] Remove the retired census from the wrapper inventory | [P2] Preserve exports or explain the replacement mock's isolation
  • reviewed 2026-10-17T09:33:34.477Z sha 01bdbeb :: needs maintainer review before merge. :: none

Reviewed October 18, 2026, 4:26 PM ET / 20:26 UTC (Revision 3).

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Fixed the retired wrapper inventory entry and the export-preserving census mock in 01bdbeb. The ownership suite passes 28/28, the eager-import closure suite passes 19/19, and the mock-export guard, focused lint, and independent review pass. The local provisioning rerun now gets past the missing-file error, but its first scenario exceeded the existing 120-second timeout; no budget or assertion was changed. Fresh exact-head CI is running.

The uid compatibility finding assumes a stable SDK export. The v2026.10.4 process-runtime barrel does not export DarwinProcess; #174284 introduced it after that release. This completes the new observation contract before stable release. All bundled Darwin consumers use relative ownership, and the type change is documented in the PR and SDK documentation. External source discovery is incomplete, so this is not a universal third-party audit.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@steipete

steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Final rebased head: 78b7cb7738da9dcf7a7c6e0afba52a80063f4bfe. CI run 39160875395, attempt 1, completed with 174 successful jobs, 22 skips, one failed test job and its aggregate gate. Final independent review through P2 and all 67 focused tests pass.

checks-node-changed-16 fails in gateway-timeout-recovery-subagent.e2e.test.ts: the child is terminal/ok, delivery is pending, but no leasable payload appears before the existing deadline. Its test, registry reader, and subagent owner are unchanged between main base e08207aea9d41cde8a8621fb1f2d3ce1296faea4 and tested merge 9480ec5f8d84702d553395fb8832b9eeb56d26d5.

Classification: unrelated delivery failure under the maintainer-approved Linux-equivalence standard. The import graphs overlap; this does not claim import isolation or a reproduced main failure. Linux returns from its unchanged procfs census branch; its rows never set owner. Added owner === "different" terms are false, and existing UID comparisons plus the systemd helper's UID guards preserve every Linux decision. The proc-safe release changes Darwin/Windows inspection and leaves Linux identity implementation unchanged. The failed handoff belongs to subagent delivery state, not Darwin inspection.

The automatic table marks the failure unknown because no matching changed-file shard exists on scheduled main. The native exception names checks-node-changed-16 and its downstream openclaw/ci-gate; failed CI remains failed. Historical UI/Telegram classifications still use the same Linux-equivalence reasoning, not the withdrawn no-import-overlap rule. No rerun, extra retry, timeout increase, or weakened assertion is used.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1e3141bc7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

pid: row.pid,
ppid: row.parentPid,
pgid: row.processGroupId,
state: states[row.state],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve Darwin live-thread state flags

When a macOS process is a zombie leader with surviving threads, ps stat reports a state containing both Z and l; the previous Node path preserved that flag, and isDeadProcessState() deliberately treats such a process as live. Mapping proc-safe's coarse zombie state to plain Z makes the Codex containment path treat it as fully exited, so terminateCodexAppServerOrphan() can report success and the durable registration can be deleted while the surviving work remains. Preserve the live-thread flag in this projection or make native Z observations conservative.

Useful? React with 👍 / 👎.

Comment on lines +448 to +449
Node and Bun use the pinned proc-safe native census and argument reader, so neither
operation executes `ps`, including inside macOS Seatbelt sandboxes. Unreadable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the SDK subpath summary for the native Node census

This new native-only contract leaves docs/plugins/sdk-subpaths.md:432 incorrectly saying that process-runtime uses a bounded ps implementation under Node. Users consulting the SDK catalog will therefore still expect ps execution and miss the newly documented Seatbelt behavior; update that summary alongside this behavior change.

AGENTS.md reference: AGENTS.md:L130-L130

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the refactor/darwin-census-proc-safe branch from e1e3141 to 78b7cb7 Compare October 18, 2026 19:54
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 18, 2026
@steipete
steipete merged commit f236b19 into main Oct 18, 2026
288 of 293 checks passed
@steipete
steipete deleted the refactor/darwin-census-proc-safe branch October 18, 2026 20:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

steipete added a commit that referenced this pull request Oct 18, 2026
On macOS the native proc-safe census reports a process in its SIGKILL
exit window as a bare row without topology, so Darwin inspection fails
closed. The Codex reaper's post-SIGKILL confirmation loops treated that
first failed observation as lost custody: every first orphan reap after
a Gateway crash failed with "Cannot reap registered Codex process", and
live transport closes could report cleanup "uncertain".

After our own SIGKILL, retry failed observations until the existing
containment deadline; runs without SIGKILL are unchanged and the
deadline still fails closed.

The orphan test's macOS "inspection unavailable" step used a fake ps,
which macOS no longer runs since #175368, so it silently became the
first real reap attempt. It now disables the native binding with
proc-safe's documented PROC_SAFE_NATIVE=off mode.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…#175368)

* refactor: share native macOS process census across runtimes

* test: preserve process snapshot fixture failure causes

* fix: complete Darwin census tooling cutover

* docs: explain breaking Darwin process ownership API
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…aw#176576)

On macOS the native proc-safe census reports a process in its SIGKILL
exit window as a bare row without topology, so Darwin inspection fails
closed. The Codex reaper's post-SIGKILL confirmation loops treated that
first failed observation as lost custody: every first orphan reap after
a Gateway crash failed with "Cannot reap registered Codex process", and
live transport closes could report cleanup "uncertain".

After our own SIGKILL, retry failed observations until the existing
containment deadline; runs without SIGKILL are unchanged and the
deadline still fails closed.

The orphan test's macOS "inspection unavailable" step used a fake ps,
which macOS no longer runs since openclaw#175368, so it silently became the
first real reap attempt. It now disables the native binding with
proc-safe's documented PROC_SAFE_NATIVE=off mode.
RomneyDa pushed a commit that referenced this pull request Oct 30, 2026
* fix(process): backport native Darwin group inspection

Backport the process census and supervisor tests from #174147. The independent Doctor diagnostics and runtime-pin migration changes are excluded.

(cherry picked from commit 6d50f72)

* refactor(process): backport the shared Darwin inspection owner

Backport the process owner, SDK exports, Codex consumer and their tests from #174284. The independent credential detection and onboarding changes are excluded. Preserve the release branch's unrelated diagnostic documentation.

(cherry picked from commit 4959773)

* refactor(process): share native macOS census across runtimes

Backport #175368. Retain fs-safe 0.26.5 and adapt native census fixtures to the release branch. Carries the approved DarwinProcess uid-to-owner SDK migration; the following package pin completes the exit-window repair.

(cherry picked from commit f236b19)

* fix(codex): retry post-kill observations through the native exit window

Backport #176576. Keep custody while retrying observations after our own SIGKILL within the existing containment deadline.

(cherry picked from commit 5f94dfb)

* fix(process): preserve macOS cleanup while unrelated processes exit

Backport #176612. Pin proc-safe 0.4.2 and its exact native package exclusions, retain the real exiting-process regression, and align the SDK summary with native inspection on both runtimes. Retain the release branch's other dependency pins and exemptions.

(cherry picked from commit 727c607)

* test(process): reuse the process group inspection helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: codex merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant