fix(macos): stop renderer injection hot loops - #310
Open
ImcLiuQian wants to merge 3 commits into
Open
Conversation
added 3 commits
July 20, 2026 17:43
Change-Id: I5357f5ff349f8d559a037909c63b67be0351a4d7
Change-Id: Icef8f4936e3bfcfd20fd96e3df125c605f288538
Change-Id: Ib5d2ba2f81fe69cb7290bf567eeffdba85951313
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.
Summary / 摘要
/avatar-overlay, and close the CDP socket when domain setup fails.Root cause / 根因
Live CDP A/B evidence confirms a Dream Skin self-triggered renderer loop: with injection enabled, the observed renderer ran ensure at about 9/s and spent about 14.1% of one core in style recalculation; after Dream Skin cleanup, style recalculation dropped to about 0.015%. An independent root/body observer saw no external class writer, while
applyRootState()unconditionally rewrote the watched root class.The historical 7.5 GiB / 200–320% CPU incident cannot be attributed solely to Dream Skin because no historical heap/socket snapshot exists. This PR fixes the confirmed Dream Skin hot loop, allocation churn, repeated bootstrap state, and handshake socket leak without claiming it was the only contributor to that high-water event.
Type / 类型
Platform / 平台
Self-check / 自测
CODEX_DREAM_SKIN_SKIP_DOCTOR=1 /bin/bash macos/tests/run-tests.shpassednode macos/tests/injector-bootstrap.test.mjs— 7/7node macos/tests/renderer-inject.test.mjs— passedstatus-dream-skin-macos.sh --json --deep: session active, injector alive, CDP OKRuntime evidence / 运行时证据
A bounded 60s post-fix sample showed ensure at about 0.28/s, style recalculation about 0.32% of one core, fixed DOM/style/chrome node counts, and JS heap 374→321 MiB. Point-in-time main Renderer samples stayed far below the historical incident (roughly 6.7–16.9% CPU, 498–590 MiB RSS), but these are observations rather than a controlled long-duration baseline.
Only
injector.mjsandrenderer-inject.jswere synced to the installed runtime for verification. Existing local CSS/theme customization was preserved; Codex itself was not restarted.Security / 安全
127.0.0.1)Notes / 补充
88d853b1a9854b4a7b34fcd78f8c81d2b8f8f269lt_home_panel_compatbranch was used as requested, so this PR also contains its two earlier home-layout commits.