fix(codex): prevent timezone injection from bypassing Windows package activation - #96
Closed
matt1060338871-pixel wants to merge 1 commit into
Conversation
…ation Resolve the exact registered manifest application for all Desktop launch paths and preserve CDP arguments. Keep standalone launches unchanged and report package lookup failures before closing processes. Represent MSIX timezone support as renderer-only, including after CCSM restarts, without prompting an ineffective refresh. Validation: 7 Windows source-harness tests, 3 UI tests, TypeScript, rustfmt, Prettier and diff checks. User cold-start reproduction confirmed direct launch error 5 versus successful package activation and CDP. Full Tauri build remains for CI.
Contributor
Author
|
CI 核对:本 PR 的 Frontend Checks 已通过。macOS/Linux 后端均在未修改的 已读取并对比基线 Windows 后端仍在运行。新增启动模块已在本机 Windows GNU 隔离工程完成编译及相关测试;完整 CI 结果以本 PR Checks 为准。 |
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.
问题与已确认原因
CCSM 3.20.2-9 在 Windows 上开启 Codex 出口时区自动模式、且已有有效检测时区时,“刷新 Codex 状态”可能关闭 Codex 后无法重新打开,报
拒绝访问 (os error 5)。触发点是刷新流程的启动目标选择:
select_launch_target为传入进程级TZ,在时区注入有效且 EXE 存在时优先选择DesktopExecutable,绕过已经存在的WindowsAumid激活入口。关闭时区时则优先使用应用包激活。因此,同为 MSIX、同一 CCSM 版本,不同设置会走不同启动分支。基线启动目标选择代码
两台机器对比与实际验证
FILE_EXECUTE权限检查也返回 Win32 错误 5;普通路径与\\?\路径结果相同。此检查不创建进程。IApplicationActivationManager::ActivateApplication启动成功,CDP/json/version可用。mode=off。无需更换 Codex 安装形式、重装或迁移历史数据。关闭出口时区是本次刷新故障已验证的临时解决办法;不能据此保证所有启动入口恢复,因为模型兼容注入和随 CCSM 启动等入口在基线中仍直接创建 EXE 进程。
修复
已注册 MSIX 包统一使用
IApplicationActivationManager::ActivateApplication,时区设置不再将刷新启动切回直接 EXE。模型兼容注入和随 CCSM 启动的入口也复用包激活,保留请求的 CDP 端口和 origin 参数。通过当前用户的包注册和 manifest 将选定 EXE 精确映射为 AUMID,兼容 Stable/Preview 共存、非
AppApplication ID、扩展长度路径和大小写差异。独立安装版继续直接启动;包注册查询错误在刷新关闭进程前返回。时区行为与限制
应用包激活无法继承 CCSM 设置的子进程
TZ,因此不把进程时区标记为已应用。保留现有 CDP renderer 时区覆盖,并展示“仅支持页面时区同步”;app-server 进程时区不保证覆盖。此状态不会引导用户反复刷新,CCSM 重启后会从运行中的包路径重建状态。代码验证
CodexEgressTimezoneStatusCard.test.tsx:3 项通过,使用原配置的程序化 Vitest 入口。tsc --noEmit、cargo fmt --check、修改的 TS/TSX 文件 Prettier 检查、git diff --check通过。proxy/handlers.rs被基线已有的clippy::too_many_arguments阻塞,详见已有 CI 核对评论。完整 CI 状态以 Checks 为准。