Repository navigation
fix(process): join owned groups through transient EPERM - #158483
Conversation
Treat Darwin EPERM as an indeterminate process-group state while preserving hard signaling errors. Require ESRCH before retiring ownership, cancel the grace timer on child close, and keep post-close escalation in the bounded group drain. Synchronize triage fixtures on the real branch-spawn receipt after maintenance finishes. Keep the existing descendant assertions and readiness budget, and abort and join the receipt waiter before cleanup releases fixture state. Cover transient and persistent EPERM, natural exit before signaling, and a later hard signaling failure using real owned child processes. All four regressions fail on the original owner and pass with this repair. Validation includes failing-before native regressions, repeated process-tree and triage cases, full test files, typechecks, changed-file type-aware lint, script lint, and independent review. Full changed checks remain blocked by pre-existing Telegram test-support unused exports. Full core lint timed out at its unchanged 900-second limit on both attempts.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 8:31 PM ET / September 26, 2026, 00:31 UTC. ClawSweeper reviewWhat this changesThe branch changes iOS signing command cleanup to wait through transient process-group permission errors and adds native process and updater-triage regression coverage. Merge readiness✅ Ready for maintainer review Current main and the latest release retain the reported EPERM failure path. The proposed repair is focused, has relevant native process proof, and has no confirmed blocking defect. Priority: P2 Review scores
Verification
How this fits togetherThe iOS release workflow uses a job-owned keychain action to run signing commands. That action must stop its child process group and report the command's result; native fixtures check its teardown and related updater-triage cleanup. flowchart LR
A[iOS release workflow] --> B[Signing keychain action]
B --> C[Bounded command runner]
C --> D[Owned process group]
D --> E[Group exit check]
E --> F[Command result or cleanup error]
G[Native regression fixtures] --> C
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +433, Config +25. Total +458 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep process-group ownership bounded, confirm disappearance before reporting the original command failure, and retain native regression coverage at the signing action. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows where an EPERM group probe escapes, and the proposed native fixture provides a focused real-child fault-injection path; this reviewer did not execute it. Is this the best way to solve the issue? Yes. The repair stays in the signing action that owns subprocess termination and preserves the original failure only after group exit is confirmed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9665d17902cf. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
) Treat Darwin EPERM as an indeterminate process-group state while preserving hard signaling errors. Require ESRCH before retiring ownership, cancel the grace timer on child close, and keep post-close escalation in the bounded group drain. Synchronize triage fixtures on the real branch-spawn receipt after maintenance finishes. Keep the existing descendant assertions and readiness budget, and abort and join the receipt waiter before cleanup releases fixture state. Cover transient and persistent EPERM, natural exit before signaling, and a later hard signaling failure using real owned child processes. All four regressions fail on the original owner and pass with this repair. Validation includes failing-before native regressions, repeated process-tree and triage cases, full test files, typechecks, changed-file type-aware lint, script lint, and independent review. Full changed checks remain blocked by pre-existing Telegram test-support unused exports. Full core lint timed out at its unchanged 900-second limit on both attempts.
What Problem This Solves
iOS signing commands can report
kill EPERMinstead of their original timeout or output-limit failure while Darwin is reaping an owned process group.User Impact
Cleanup waits for confirmed process-group disappearance and preserves the original command failure after transient permission errors. Persistent permission errors and later hard signaling errors still fail. No configuration or migration is required.
Why This Change Was Made
Treat
EPERMas indeterminate, retire group ownership only afterESRCH, and keep post-close escalation in the bounded drain. The regression fixtures use real owned child processes. Triage fixtures wait for their actual branch-spawn receipt after maintenance and cancel/join that waiter before cleanup.This replays campaign batch p003. Main's newer triage cleanup from #155736 and Node subprocess test structure from #146807 are preserved. No changed path matches the current CODEOWNERS file.
Evidence
6524a5a14b9bb4001c24cef060aa4a678c48ccc0, treed4b8f26ffe7ee368ee96108c28b15eb2ac35a1ab.CI=1 pnpm test src/infra/update-managed-service-triage.test.ts test/scripts/mobile-release-authority.test.ts --maxWorkers=1passed: 138 tests across both complete files. Testbox backing run. The wrapper returned exit 0 and stopped its lease; the backing Actions run may show cancelled because the external lease owns execution and cleanup.oxfmtandgit diff --checkpassed. Independent Codex review found no actionable P0-P2 findings.OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <five changed paths>completed all selected typechecks, ratchets, formatting, guards, and dead-export scans. The overall command exits 1 solely because core lint reports 1,025 lines against a 1,000-line cap in unchangedsrc/agents/embedded-agent-runner/run/attempt-session-replay.test.ts. Changed-check run.a044077163354e127562db74bbdf5f618b9745d6using its unchanged file and lint configuration. The remainingpnpm lint:scriptsand changed root-test type-aware lint both passed with zero warnings/errors. Baseline and remaining-lint run. No assertion, timeout, skip, or baseline was weakened.Production/tooling: +37/-12 lines. Tests/support: +438/-5 lines.