Repository navigation
fix(cli): restore macOS system CA trust - #113112
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
July 23, 2026 17:28
Contributor
Author
|
Land-ready proof for head
Known proof gaps: none for the CLI trust/exit contract. Extended stable |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 24, 2026
* fix(cli): preserve macOS system CA trust * test(cli): satisfy one-shot exit lint * test(cli): cover finalizer through public lifecycle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #113108
Follow-up to #110341 and #112868
What Problem This Solves
Fixes an issue where macOS one-shot commands avoided a Node Keychain shutdown hang by disabling inherited system CA trust. The later bundled-CA mitigation restored public WebPKI, but private enterprise and Keychain-only roots still disappeared despite
NODE_USE_SYSTEM_CA=1or an explicit--use-system-caoption.Why This Change Was Made
OpenClaw now preserves Node's inherited and explicit CA policy. The respawn layer no longer changes
NODE_USE_SYSTEM_CAor inserts bundled/OpenSSL CA flags.The shutdown fix moves to the outer CLI lifecycle boundary. After a command has returned, failure diagnostics have been emitted, shared harness/memory/proxy teardown has completed, and stdout/stderr have drained, macOS processes actually using system CA exit explicitly. Long-lived commands are not preclassified or interrupted: their run promise must settle before finalization executes.
Command-specific exit codes remain authoritative. Failure reporting overwrites a previously queued successful help exit, integer-string
process.exitCodevalues are normalized, and both--use-system-caand Node's valid--use_system_caspelling are recognized.User Impact
macOS one-shot commands retain system and login Keychain trust—including private enterprise roots—while still exiting promptly. Public roots,
NODE_EXTRA_CA_CERTS, explicit bundled/OpenSSL choices, interactive commands, watchers, foreground Gateway runs, and embedded custom runtimes keep their existing behavior.Evidence
NODE_USE_SYSTEM_CAremained1; system certificates were present; the default CA set included system roots;config validate --jsonemitted complete JSON and exited with its expected nonzero status in 1.604 seconds.30028887363:check:changedpassed formatting, core and test typechecks, lint, database/storage guards, and import-cycle checks.pnpm deadcode:fullpasses after keeping low-level drain/system-CA helpers private and testing through the production outer finalizer.gpt-5.6-sol, xhigh, P0-P2) reported no accepted or actionable findings after failure-ordering, teardown, option-spelling, Vitest-marker, and exit-code findings were applied.git diff --checkand targeted formatting are clean.AI-assisted: yes. The process lifecycle and Node CA contracts were repeatedly reviewed and behavior-tested before submission.