Repository navigation
improve(gateway): overlap macOS system-CA warmup with startup - #128422
Merged
Merged
Conversation
Measured on this machine, the first boot after the OS trust cache went cold spent 4972ms in post-attach.system-ca; a fresh standalone Node process took 3529ms, while subsequent boots took 16-160ms. Start the single-flight warmup after kernel creation so the existing post-attach barrier observes only the residual wait.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 24, 2026 00:19
Contributor
Author
|
ClawSweeper Rank-up moves: none published for the current head. The latest live comment remains the |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 24, 2026
…w#128422) Measured on this machine, the first boot after the OS trust cache went cold spent 4972ms in post-attach.system-ca; a fresh standalone Node process took 3529ms, while subsequent boots took 16-160ms. Start the single-flight warmup after kernel creation so the existing post-attach barrier observes only the residual wait.
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.
What Problem This Solves
Fixes an issue where a macOS Gateway could spend up to 4972ms of a first boot after the OS trust cache went cold waiting for the default system CA set on the readiness critical path. The same lookup measured 3529ms in a fresh standalone Node process, while subsequent Gateway boots measured 16-160ms.
Why This Change Was Made
The Gateway now starts one process-wide system-CA warmup immediately after kernel creation, allowing the Keychain read to overlap the remaining bootstrap and attach work. The existing post-attach barrier awaits that same retained promise before plugins or worker providers can use TLS; warmup failures remain fail-open and are not retried because this is only an optimization. Minimal test gateways remain unchanged. No config or changelog surface is added.
User Impact
Cold macOS Gateway starts can overlap the expensive trust-cache read with other startup work instead of paying the full delay serially before readiness. Warm starts and non-macOS platforms retain their existing behavior.
Evidence
node scripts/run-vitest.mjs src/gateway/system-ca-warmup.test.ts— 16 tests passed across 2 configurations.node scripts/run-vitest.mjs src/gateway/server-import-boundary.test.ts— 16 tests passed across 2 configurations.node scripts/run-vitest.mjs src/gateway/server-startup-post-attach.test.ts— 168 tests passed across 2 configurations; the injected barrier still completes before worker reconciliation and sidecars.node scripts/check-changed.mjs— Blacksmith Testbox sync timed out before the checks ran (exit 124); the authorized local fallback completed all selected core and core-test gates successfully.pnpm build— passed./readyz; residual barrier trace:startup trace: post-attach.system-ca 0.5ms total=1456.6ms eventLoopMax=0.0ms..claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean, no accepted/actionable findings.