fix: watcher backoff, selector provenance gate, and a testable Windows artifact - #387
Merged
Conversation
Nothing in the shipped Windows path ever passed -ProfilePath, so the launcher never sent --user-data-dir, and Chromium 136+ ignores --remote-debugging-port for its default data directory. The debugging endpoint therefore never opened on current Codex builds and the skin simply did 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. 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. The managed profile costs a one-time Codex sign-in inside it; that is recorded in the changelog. Also stop the selector contract's provenance from rotting. verifiedAgainst still claimed 26.727.40816 while the contract had been extended through 26.818, which makes every doctor report that quotes it misleading. Rewrite it as a per-build list that states its own evidence strength (maintainer / reporter / fixture), add the gaps we know about, and add tools/check-selector-provenance.mjs plus a CI step so changing selectors without restating what they were checked against fails the build. docs/compat-profile-design.md records the structural fix this points at: a signed, hot-updatable selector profile, so an upstream DOM change stops requiring a full client release. Design only, not implemented.
This was referenced Aug 27, 2026
The target-discovery backoff capped at a flat 500ms regardless of how long the endpoint had been gone, so once Codex exited the watcher kept polling roughly twice a second for as long as it stayed loaded and wrote `fetch failed` to the error log every 2s. Reporters saw the machine become noticeably sluggish with no Codex running at all. Keep the fast ramp for short outages — a reload, navigation, or renderer restart also fails discovery, and the watcher is what repaints the skin afterwards — and escalate the ceiling only once discovery has failed continuously: 5s after 10s of outage, 30s after 60s. Ten idle minutes drop from about 1200 polls to 55; an idle hour from 7200 to 155. Error logging follows the same curve so an overnight watcher cannot fill injector-error.log. Deliberately not "stop the watcher when Codex exits": that is what breaks live theme switching after a reopen (#200).
This was referenced Aug 27, 2026
Open
The Windows job compiled the installer as a build check and discarded it, so a Windows-only fix could not be handed to a reporter for field verification: the maintainer has no Windows host, and a reporter cannot test a branch without an installer. macOS has published its DMG all along.
It is the only change in this pass that cannot be verified without a Windows host, and bundling it here meant the provenance gate, the #218 watcher fix and the CI installer artifact could not ship until someone found a Windows tester.
check-update-macos.sh answers "which version am I running" by reading the VERSION file next to itself, and the client preferred the copy inside the deployed engine. That copy can lag the app indefinitely: the engine installs asynchronously after launch, and the installer refuses outright while Codex is open — this machine's own start-error.log shows four such refusals in ninety seconds today, right after updating to 1.5.16. While that refusal stands the app bundle is the new version and the engine is still the old one, so currentVersion comes back stale, updateAvailable turns true, and the client notifies about the exact version it is already running. Prefer the bundled copy for the update check only, keeping the deployed engine as a fallback. The app bundle is the one source that cannot be stale. Every other script keeps resolving installed-first, because for those the deployed engine is the thing actually doing the work.
With `pull_request: branches: [main]` a PR based on another branch ran no checks at all, so splitting a change out for separate review silently cost it its tests and its Setup.exe artifact.
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.
拆分后的版本:这个 PR 里的每一项都已在本机或 CI 上验证过,可以直接合。 唯一需要 Windows 实机确认的受管 CDP profile 已移到 #390。
1. macOS watcher 空转把机器拖卡(#218)
在维护者本机复现了,不是转述报告者:
4 分 22 秒里 82 行,而实际轮询频率是每秒约 2 次(日志被 2 秒节流了)。根因是退避上限写死 500ms,不管端点已经消失多久:
改成上限随连续失败时长升级:10 秒内维持 500ms(重载 / 导航 / renderer 重启照常快速重连),10 秒后 5s,60 秒后 30s。
错误日志写入间隔同步跟随退避,挂一整夜不会撑大
injector-error.log。特意没有采用「Codex 退出就停掉 watcher」(#264 / #353 两个 draft 的方向):短暂中断同样会让目标发现失败,而 watcher 正是重新上色的东西,停掉它就是 #200 报告的「关闭重开后热切换失效」。
回归:
macos/tests/discovery-backoff.test.mjs,6 项。2. CI 发布 Windows Setup.exe 产物
Windows job 一直在编译 Setup.exe 做构建检查,然后丢掉;只有 macOS 会上传 DMG。结果是每一个 Windows-only 修复都无法验证——维护者没有 Windows 主机,而报告者又没法测一个分支。
现在 Setup.exe 和 DMG 一样作为 artifact 上传(保留 7 天,
if-no-files-found: error)。#390 就是第一个受益者。3. 选择器合同 provenance 闸门
verifiedAgainst到今天还写着26.727.40816,而合同里的选择器早已扩展到 26.818。任何引用它的 doctor 报告因此都是误导性的。maintainer/reporter/fixture,另加gaps记录已知未验证面。tools/check-selector-provenance.mjs+ CI 步骤:改selectors[]而不动verifiedAgainst→ 构建失败。base 文件只比较不校验形状,所以引入规则的这个提交能通过自己的闸门。4.
docs/compat-profile-design.md(仅设计)签名的、可热更新的 selector / Safe CSS 兼容档案,从
api.dreamskin.cc分发,让上游 DOM 变更不再需要发整版客户端。含 fail-closed 校验顺序、「只允许覆盖 selector 字符串」的有界降级面、「档案是数据不是代码」的硬边界。Validation
node --test macos/tests/*.test.mjs windows/tests/*.test.mjs tools/*.test.mjs:121/121 PASSnode tools/sync-runtime-assets.mjs --check:PASSnode {macos,windows}/scripts/injector.mjs --check-payload:PASSnode --check、git diff --check:PASSorigin/mainbase 跑通,负例在单测里覆盖Scope boundary
不改主题包、配色或用户设置。不修改官方 Codex 二进制或
app.asar。不发版、不改版本号。