Skip to content

[Bug]: [Windows] Reopening Codex stops injector and breaks live theme switching / 关闭重开后主题切换失效 #200

Description

@YJGjerry

Platform / 平台

Windows

OS version / 系统版本

Windows 11 25H2 · Build 26200.8875

CPU / 架构

Windows x64

Codex Desktop version / source / Codex 桌面版版本或来源

Codex 26.715.8383.0 · Microsoft Store official package

Dream Skin version / 皮肤工具版本

1.2.0 · injector.mjs matches current upstream main; Windows state/runtime directory was locally relocated to another drive.

Problem category / 问题类型

Hot reapply / CDP / 热切换或 CDP

Self-check / 自检

  • Ran Verify / doctor (or Windows verify script) / 已运行 Verify 或 doctor
  • Tried Restore, then re-apply / 已尝试完全恢复后再应用
  • Official Codex still opens without the skin tools / 不用皮肤工具时官方 Codex 仍可正常打开
  • Searched existing issues / 已搜索现有 Issue

Steps to reproduce / 复现步骤

中文:

  1. 通过 Dream Skin 启动 Codex,确认皮肤、系统托盘和 injector 均正常运行。
  2. 完全关闭 Codex。
  3. 再次打开 Codex。
  4. 部分情况下 Codex 会以无皮肤状态启动;另一些情况下,之前注入的皮肤仍留在界面上,但 injector.mjs 已不再运行。
  5. 从 Windows 托盘中选择另一个已保存主题。
  6. 托盘提示主题已应用,且 active-theme/theme.json 确实发生变化,但 Codex 界面仍显示之前的主题。

English:

  1. Start Codex through Dream Skin and confirm that the skin, tray, and injector are working.
  2. Completely close Codex.
  3. Open Codex again.
  4. In some runs Codex opens without the skin. In other runs the previously injected skin remains visible, but injector.mjs is no longer running.
  5. Select another saved theme from the Windows tray.
  6. The tray reports that the selected theme was applied and active-theme/theme.json changes, but the visible Codex theme does not update.

Expected behavior / 期望结果

中文:

Codex 关闭并重新打开后,Dream Skin 应能够恢复或重新连接 injector。从托盘选择已保存主题时,界面应立即切换,无需用户手动重新运行 start-dream-skin.ps1

English:

After Codex is closed and reopened, Dream Skin should restore or reconnect its injector. Selecting a saved theme from the tray should update the visible theme without requiring the user to manually rerun start-dream-skin.ps1.

Actual behavior / 实际结果

中文:

原有 CDP browser identity 关闭后,injector watcher 随之退出。系统托盘可能仍然存在,并提示新主题已应用,但由于已经没有 injector 监听 active-theme/theme.json,Codex 界面仍停留在之前的主题。

English:

The original CDP browser identity closes and the injector watcher exits. The tray may remain available and report that a new theme was applied, while the UI continues showing the previous theme because no injector is watching active-theme/theme.json.

Modified official Codex install? / 是否改过官方 Codex 安装?

No — official app only / 否,仅官方安装

Logs / Verify / doctor output(recommended)/ 日志与校验输出(强烈建议)

[dream-skin] original CDP browser identity closed;
watcher is stopping instead of reconnecting

Observed state after reproduction:
- Codex CDP port: listening
- Windows tray: running
- injector.mjs --watch: not running
- active-theme/theme.json: updated successfully
- visible UI: still shows the previous theme
- verify after manually restoring the injector: pass=true
- Dream Skin injector version: 1.2.0

Screenshots / video / 截图或录屏

Not attached to avoid exposing private desktop/chat content. A screenshot is available showing the tray notification reporting a new theme while the previous theme remains visible.

Extra context / 其他信息

Related to #162, but this reproduction does not require a Microsoft Store update. A normal Codex close and reopen is sufficient.

A local experimental recovery monitor was tested: when Codex is still running with CDP but injector.mjs is missing, invoking the existing start-dream-skin.ps1 flow restores the injector without restarting Codex. After recovery, saved-theme hot switching works again.

The official Codex package, WindowsApps, and app.asar were not modified. The Dream Skin state/runtime directory was locally relocated to another drive, but the tested injector.mjs is byte-identical to current upstream 1.2.0.

Confirmation / 确认

  • I did not paste API keys or secrets / 我未粘贴 API Key 或其它密钥
  • I understand this is an unofficial theme tool (loopback CDP only) / 我理解这是非官方换肤工具(仅本机 CDP)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus: consideringMaintainer likes the idea, evaluating for a future merge

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions