Welcome GPT-5.6! Support ChatGPT.app fallback for macOS launch#1390
Conversation
f0d307e to
c4d2325
Compare
c4d2325 to
ada465a
Compare
LeoLin990405
left a comment
There was a problem hiding this comment.
在另一台机器上独立复现并验证了这个 PR 的思路,结论一致,LGTM。也顺带把我自己重复提的 #1391 关掉了——你这版更好(见下)。
独立验证 / Independent verification
环境:macOS,Codex 桌面端 26.707.31428(/Applications/Codex.app 已消失)。
$ /usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" /Applications/ChatGPT.app/Contents/Info.plist
com.openai.codex ← bundle id 未变(不是 com.openai.chat)
$ /usr/libexec/PlistBuddy -c "Print :CFBundleExecutable" ...
ChatGPT
$ ls /Applications/ChatGPT.app/Contents/MacOS/
ChatGPT
$ mdfind "kMDItemCFBundleIdentifier == 'com.openai.codex'"
/Applications/ChatGPT.app ← 全机唯一
ChatGPT.app 内仍含 Codex Framework.framework、Resources/codex,以及注入所依赖的 /webview/assets/*.js(含 app-initial~app-main~*)。
按本 PR 的两处改动打上后,在真机上跑解析:
find_macos_codex_app(["/Applications"]) → Some("/Applications/ChatGPT.app")
build_codex_executable(...) → "/Applications/ChatGPT.app/Contents/MacOS/ChatGPT" exists = true
cargo test -p codex-plus-core 全绿、无回归。确认这个修法能真正让 Codex++ 在 26.707 上重新启动。
两点小赞 / Two things I think are right
.filter(|value| !value.contains('/') && !value.contains('\\'))—— 对CFBundleExecutable做路径穿越防护,我自己那版漏了,这里做得对。- 把
macos_app_version重构成通用的macos_app_plist_value(app_dir, key)再复用,比另写一个单用途函数干净。
一个后续建议(非阻塞)/ Follow-up (non-blocking)
bundle id com.openai.codex 这次没变。 所以更彻底的防未来改名做法是:按 bundle id 发现(macOS 上可用 LaunchServices / mdfind kMDItemCFBundleIdentifier),而不是继续往候选名单里追加名字。本 PR 已经足够修好当前问题,这个可以作为独立的后续优化。
⚠️ Windows 还有个洞 / Windows is still broken
#1389 的报告人是 Windows。Windows 侧走的是
const CODEX_PACKAGE_IDENTITIES: &[&str] = &["OpenAI.Codex", "OpenAI.CodexBeta"];匹配 WindowsApps 下的包名。改名后大概率同样匹配不上,而本 PR(和我关掉的 #1391)都只修了 macOS。需要一位 Windows 用户提供改名后的包名(Get-AppxPackage | ? {$_.Name -like "*Codex*" -or $_.Name -like "*ChatGPT*"} 的输出),才能把 Windows 那半补上。
CI 说明 / About the failing check
Windows artifacts 这个 job 挂的是 cargo test -p codex-plus-core --test ads(6 passed; 1 failed),和 app_paths 无关;而且同一 workflow 在 main 上也在失败(#1325、#1360 的合并提交都是 failure)。也就是说这是既有的 Windows ads 测试问题,不该卡住本 PR。macOS 的两个 DMG job 都是 pass。
|
今天 ChatGPT 和 Codex 合并后不能正常运行,安装最新版本后问题依旧。聊天框发送信息提示:Invalid Value: 'tools.namespace'. User-defined namespace 'image_gen' collides with an existing tool namespace. |
摘要
ChatGPT.app,这次补上 Codex++ 对新ChatGPT.app的启动兼容。ChatGPT.app,避免破坏旧安装环境。.app时读取Info.plist里的CFBundleExecutable,确保ChatGPT.app启动真实的Contents/MacOS/ChatGPT。测试
git diff --checkcargo test -p codex-plus-core --test launcher