fix(windows): pair remote debugging with a managed CDP profile (#235) - #390
Merged
Conversation
Fei-Away
force-pushed
the
codex/windows-cdp-profile
branch
from
August 27, 2026 15:48
cf3c2d7 to
a6958bb
Compare
Fei-Away
added a commit
that referenced
this pull request
Aug 27, 2026
…able Windows artifact (#387) Four verified fixes plus one design note. The unverifiable managed CDP profile was split out to #390. - #218: the macOS watcher's discovery backoff capped at a flat 500ms regardless of how long the CDP endpoint had been gone, so an exited Codex left it polling twice a second. Reproduced on the maintainer's own machine: 82 `fetch failed` lines in 4m22s. The ceiling now escalates with continuous outage (500ms → 5s after 10s → 30s after 60s), cutting ten idle minutes from ~1200 polls to 55. Not 'stop the watcher on exit', which is what breaks live switching after a reopen (#200). - The client announced updates to the version it was already running. `check-update-macos.sh` reads the VERSION file beside itself, and the client preferred the deployed engine's copy — which lags indefinitely whenever the engine install is refused because Codex is open. Prefer the bundled copy for the update check only. - CI compiled the Windows Setup.exe as a build check and discarded it, leaving every Windows-only fix unverifiable. It is now published as an artifact like the macOS DMG. `pull_request` also no longer filters on base branch, so a stacked PR still gets tests and an installer. - `verifiedAgainst` claimed Codex 26.727 while the contract covered 26.818, making any doctor report quoting it misleading. Rewritten per-build with explicit evidence strength (maintainer/reporter/fixture) and a gaps list, plus `tools/check-selector-provenance.mjs` and a CI gate. - `docs/compat-profile-design.md`: design only, for a signed hot-updatable selector profile. Verified: 124/124 portable Node tests, sync --check, both payload checks, Swift typecheck (macOS 14.4 SDK), full CI green including PowerShell 5.1 and 7. No version bump, so the release guard treats this as version_unchanged and publishes nothing.
Nothing in the shipped Windows path ever passed -ProfilePath:
grep -rn 'ProfilePath' windows/ --include='*.ps1' --include='*.mjs' \
| grep -v start-dream-skin.ps1 # no output
So `if ($ProfilePath) { $arguments += "--user-data-dir=$ProfilePath" }` was dead
in every real install and --user-data-dir was never sent. Chromium 136+ ignores
--remote-debugging-port for its default data directory, so on current Codex
builds the debugging endpoint never opens and the skin does not appear.
Default to a persistent managed %LOCALAPPDATA%\CodexDreamSkin\cdp-profile, keep
an explicit -ProfilePath as an advanced override, and assert exactly one managed
--user-data-dir argument plus an existing directory before launch.
start-dream-skin.ps1 is the only script that launches Codex with debugging
flags, so no second launch path can disagree about the profile, and no consumer
reads state.profilePath as an override marker.
Adopted from #363, whose reporter verified the fix on Store Codex
26.803.10989.0 / Chromium 151.0.7922.76 with a real theme injection. Known cost:
the managed profile is isolated from the official Codex profile, so it needs a
one-time Codex sign-in inside it.
Fei-Away
force-pushed
the
codex/windows-cdp-profile
branch
from
August 27, 2026 16:09
a6958bb to
19303d5
Compare
This was referenced Aug 27, 2026
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.
这是不是 bug —— 有一半不需要 Windows 机器就能确认
出厂路径里没有任何调用方传过
-ProfilePath:所以这个分支在每一次真实启动中都为假:
--user-data-dir从来没有被发出去过。 而 Chromium 136 起会忽略指向默认数据目录的--remote-debugging-port。两者相乘 = 当前 Codex 上调试端点根本不开、injector 连不上、皮肤完全不生效。这是代码事实,不需要 Windows 主机就能确认。需要实机确认的只有第二半:「补上受管
--user-data-dir之后 CDP 就恢复」。依据是 #363 报告者在 Store Codex26.803.10989.0/ Chromium151.0.7922.76上的对照探测——只传端口没有端点;同一个签名可执行文件加上隔离--user-data-dir后,回环 Browser WebSocket、app://-/index.htmlrenderer、真实主题注入验证全部通过。合并前的复核记录
grep -rn "remote-debugging" windows/scripts/除start-dream-skin.ps1外只命中common-windows.ps1里的Get-DreamSkinCodexDebugArgumentStatus,那是读命令行做判定、不是启动。所以不存在「某条路径带受管 profile、另一条不带」的分裂风险。state.profilePath当作"用户覆盖"标记。 该字段现在总会被填上,但 grep 确认无人据此分支。Ensure-DreamSkinManagedDirectory -Path $ProfilePath -Root $StateRoot:cdp-profile直接位于 StateRoot 之下,包含性检查成立。怎么测(不用 clone 分支)
本 PR 的 CI 会直接产出可安装的 Setup.exe:
CodexDreamSkin-setup(约 23.7 MB)CodexDreamSkin-Setup-v1.5.16.exe,正常安装(这个能力是 #387 刚加的:此前 CI 只是编译 Setup.exe 做构建检查然后丢掉,只有 macOS 会上传 DMG。所以以前 Windows 侧的修复根本没法交给报告者验证。)
请测试者确认三件事:
%LOCALAPPDATA%\CodexDreamSkin\cdp-profile是否被创建合并不等于发版
macos/VERSION未变(仍是 1.5.16),release workflow 的 guard 会判定version_unchanged=true→should_release=false。合进 main 不会推给任何用户,要等到有人 bump 版本号切 v1.5.17 才会真正发布。所以实机验证仍可在发版前完成。已从 #387 拆出并 rebase 到
main,现在是对 main 的单 commit / 6 文件。