fix(desktop): 共用 Work Louder 保护设置并精简重启提示 - #3983
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/worklouder-codex/CodexMicroGuardService.ts | 增加进程扫描、条件重启状态、心跳刷新和回执清理编排,未发现确定的生命周期或并发缺陷。 |
| apps/desktop/src/main/worklouder-codex/codexMicroGuardProcesses.ts | 使用受限的 ps 调用识别受支持的 Codex 与 ChatGPT 桌面主进程。 |
| apps/desktop/src/main/worklouder-codex/codexMicroGuardHook.cjs | 在原有拦截成功时额外写入私有的进程身份回执,诊断写入失败不会改变拦截行为。 |
| apps/desktop/src/main/worklouder-codex/codexMicroGuardCore.ts | 新增进程回执验证及仅针对已退出进程的过期回执清理。 |
| apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx | 将共享保护设置置底,并仅在保护尚未应用到存活旧进程时显示重启提示。 |
| apps/desktop/src/shared/codexMicroGuard.ts | 为共享保护状态增加向后兼容的可选 restartRequired 字段。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[启用 Work Louder 保护] --> B[安装 NODE_OPTIONS hook]
B --> C[记录保护开始时间]
C --> D[扫描 Codex / ChatGPT 主进程]
D --> E{进程早于保护启动?}
E -- 否 --> F[无需重启提示]
E -- 是 --> G{存在匹配的进程回执?}
G -- 是 --> F
G -- 否 --> H[显示完全退出并重新打开提示]
I[Codex 加载 Work Louder 服务] --> J[hook 拦截服务]
J --> K[写入 PID、启动时间及路径回执]
K --> D
L[心跳刷新或显式读取状态] --> D
Reviews (1): Last reviewed commit: "fix(desktop): share Work Louder protecti..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acc40c2250
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24e1825c0d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…n needed Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
24e1825 to
6c086b8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c086b8c55
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
命中 UI 路径(apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范 |
MagicLizi
left a comment
There was a problem hiding this comment.
代码重审通过:Work Louder 保护设置共用一份本机覆盖,重启提示只暴露 boolean,PID 不出 Main。当前 head 没有 P0/P1。
|
合了。两套 Work Louder 共用一份保护开关,重启提示也不再把进程细节漏到界面上。 |
这次改了什么
摘要
Codex Micro 与 Creator Micro 2 共用页面底部的保护开关,移除“已关闭”等冗余标签,重启提示放在开关左侧。
用户明确将提示范围收敛为:手动打开选项时,检查 Codex 是否正在运行;开着就提示,没开就不提示。关闭选项或当时的 Codex 退出/重启后清除提示。Cindy 启动恢复偏好不触发提醒。两款键盘继续共用配置与服务,保留默认键位和固件映射差异。
变更类型
fix缺陷修复范围
UI 变化
docs/design-rules/DESIGN.md§1、§5、§10、§11:复用现有设置行、开关与语义颜色,保持低强调提示,去除重复状态文案,同时实现 Light / Dark 主题样式。怎么验证的
自动验证
pnpm test:unit:related:通过(Desktop 关联单测)。pnpm --filter desktop run --if-present typecheck:通过。pnpm check:i18n、pnpm check:i18n-glossary:通过,无新增术语违规。bash /Users/dash/Code/XD/dash/Skills/git/scripts/run-unit-gate.sh <worktree>:脚本测试 503 通过,Desktop、Mobile 及其他共享包通过;maker-core有 2 项 Pi 集成测试失败。origin/main基线47ef43edd9861453c4c5e00583c8184840e2fced上使用相同 Pi 二进制复跑对应两项测试:同样失败(dotenv symlink 用例 60 秒超时;redirect globs 用例期望['bash']、实际[])。测试位于packages/maker-core/src/agents/pi/__tests__/pi-agent.integration.test.ts:2361和:2510,本 PR 未修改该包。基线工作区复跑后仍干净。pnpm --filter @cindy/maker-core exec vitest run src/agents/pi/__tests__/pi-agent.integration.test.ts --pool=forks --maxWorkers=1 --testNamePattern 'auto mode escalates bash input redirects reached through a dotenv symlink|redirect globs fail closed on inherited or runtime Bash options while ordinary globs stay fast'。git diff --check:通过。新增回归覆盖:两型号设置位置及共用开关、恢复操作;手动开启时 Codex 已开/未开、开启后才启动 Codex、退出、PID 复用的重启、关闭开关、Cindy 重启以及扫描失败。
提示状态不变量:仅由显式开启创建当时的进程列表;查询/现有心跳只移除已退出的进程,不加入新进程;关闭、恢复、退出 Cindy 或检测失败清空。空列表不继续扫描。启动恢复偏好不创建列表。进程探测不改变拦截条件。
手工验证
macOS 上执行了只读进程探测,命令正常返回;当时未运行独立 Codex 应用。没有据此宣称硬件保护已实机验证。
未执行的验证
未进行两款真实键盘联调、真实 Codex 重启流程,以及 Light / Dark 客户端目检;本次以回归测试验证状态和界面行为。
风险
风险分类
影响与回滚
提交前检查
git commit -s)