Skip to content

Commit 8826a2a

Browse files
authored
fix(macos): [MOC-320] 适配 Codex 26.707 改名 Codex.app→ChatGPT.app (#596)
* fix(macos): [MOC-320] 适配 Codex 26.707 改名 Codex.app→ChatGPT.app Codex 桌面 26.623→26.707 把 bundle 从 Codex.app(进程/exe Codex)改名 ChatGPT.app(进程/exe ChatGPT),bundle id/user-data-dir 不变。transfer 硬编码 Codex 名致重启杀不掉旧进程、登录找不到 codex CLI。 - process.rs: pkill/pgrep 从 -x <名> 改 -f 正则 (Codex|ChatGPT)\.app/... (避开同 exe 名的 ChatGPT Classic 误杀);resolve_macos_app_path 加 ChatGPT.app 候选,保留 Codex.app 兜底旧安装。 - codex_real_account.rs: resolve_codex_cli app 候选加 ChatGPT.app。 Refs MOC-320 * fix(dev): [MOC-320] beforeDevCommand 去掉 --prefix 叠层 tauri-cli 2.x 跑 beforeDevCommand 的工作目录是 frontend 目录本身 (dev.rs:158 fallback dirs.frontend),配置里再写 npm --prefix frontend 就叠成 frontend/frontend → ENOENT,README 文档的 cargo tauri dev 恒定 报错。改为直接 npm install && npm run dev。打包路径(make mac-app 自跑 npm)不受影响。 Refs MOC-320 * docs: [MOC-320] CHANGELOG Unreleased 补 26.707 改名适配条目 Refs MOC-320 * fix(macos): [MOC-320] 逐 PID bundle id 归属校验,防误杀消费级 ChatGPT.app + open -b 兜底 review 加固两条(chatgpt-codex-connector P2): - 路径正则只能筛候选不能定身份:消费级 ChatGPT 客户端未更名的安装同样叫 ChatGPT.app,盲杀会误伤。借鉴 codex-account-switch PR #51 的 pid-class 方案:pgrep -fl 枚举候选 → 逐 PID 读 Info.plist CFBundleIdentifier 三分 类(Ours=com.openai.codex / Other / Unknown),只对 Ours 发 TERM/KILL, Unknown 计入在跑但绝不杀(交人工);Other(消费级)不算在跑也不杀。 - resolve_macos_app_path 按内嵌 codex CLI 资格审候选(目录存在不够,消费级 bundle 无 Contents/Resources/codex);全落空时 open 从 -a Codex 改 -b com.openai.codex(新旧两代同 bundle id,自定义安装位置/26.707-only 都能启,且按 id 永不解析到消费级客户端)。 - 真机只读实证:全树 11 个候选 PID 全归属 com.openai.codex;消费级 Classic=com.openai.chat 判 Other。process 模块 20 tests 全绿。 Refs MOC-320 * fix(dev): [MOC-320] beforeDevCommand 显式锚定 cwd=../frontend + CHANGELOG 同步 review 加固(chatgpt-codex-connector P2):tauri-cli 2.x 按调用处 cwd 推导 beforeDevCommand 工作目录(app_paths.rs resolve_frontend_dir:从 cwd 找 package.json,找不到 fallback 仓库根),裸命令从 src-tauri 起跑仍会炸。改 object 形式显式 cwd(相对 src-tauri 解析),任意目录起 dev 都确定性正确。 CHANGELOG 条目同步 bundle-id 归属校验与 cwd 锚定表述。 Refs MOC-320
1 parent 2683f65 commit 8826a2a

4 files changed

Lines changed: 251 additions & 56 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
## Unreleased
66

7+
**适配 Codex 桌面 26.707 改名 Codex.app→ChatGPT.app(MOC-320)**:Codex 桌面 26.623→26.707 把 bundle 从 `Codex.app`(进程/可执行名 `Codex`)改名为 `ChatGPT.app`(进程/可执行名 `ChatGPT`,bundle id 与 user-data-dir 不变),transfer 硬编码旧名导致「重启 Codex」杀不掉旧进程(重启后实例堆积)、登录路径找不到 app 内置 codex CLI。进程匹配改为「.app bundle 路径正则枚举候选 + 逐 PID 验 Info.plist bundle id(`com.openai.codex`)归属,只对归属确认的进程发信号」:同时覆盖新旧两种安装,即便消费级 ChatGPT 客户端未更名仍叫 `ChatGPT.app` 也不会被误杀(身份不明进程计入"在跑"但绝不杀,交人工处理);app 路径解析按「内嵌 codex CLI」资格审(优先 `ChatGPT.app`、`Codex.app` 兜底旧安装),路径全落空时按 bundle id `open -b` 启动(自定义安装位置也能启);内置 CLI 解析同步加 `ChatGPT.app` 候选。已在 26.707 真机验证重启正常杀旧进程。**开发流程**:修复 `cargo tauri dev` 恒定报 `frontend/frontend` ENOENT —— tauri-cli 2.x 按调用处 cwd 推导 beforeDevCommand 工作目录,改为显式锚定 `cwd: "../frontend"`,任意目录起 dev 都确定性正确。/ **Adapts to Codex desktop 26.707 renaming Codex.app→ChatGPT.app (MOC-320)**: Codex desktop 26.623→26.707 renamed its bundle from `Codex.app` (process/executable `Codex`) to `ChatGPT.app` (process/executable `ChatGPT`; bundle id and user-data-dir unchanged); transfer's hardcoded old name meant "Restart Codex" could not kill the old process (instances piled up after restart) and the login path could not find the app's bundled codex CLI. Process matching now enumerates candidates via an .app bundle-path regex and then verifies each PID's Info.plist bundle id (`com.openai.codex`), signalling only positively-owned processes: both old and new installs are covered, a consumer ChatGPT client still named `ChatGPT.app` is never killed (unidentifiable processes count as "running" but are never signalled), app-path resolution qualifies candidates by the embedded codex CLI (preferring `ChatGPT.app`, falling back to `Codex.app`) with an `open -b` bundle-id fallback when no path qualifies (custom install locations still launch), and bundled-CLI resolution gains the `ChatGPT.app` candidate. Verified on a real 26.707 machine that restart kills the old process. **Dev workflow**: fixes `cargo tauri dev` always failing with `frontend/frontend` ENOENT — tauri-cli 2.x derives the beforeDevCommand working directory from the invocation cwd, so the config now pins `cwd: "../frontend"` explicitly, making dev deterministic from any directory.
8+
79
**接入 Grok Build 供应商(xAI grok CLI 编码后端,MOC-299)**:接入 xAI grok CLI(grok-code)的编码后端 `cli-chat-proxy.grok.com/v1` 为新灰色供应商。协议是标准 OpenAI Responses,直接复用 `ResponsesPassthroughMapper` 1:1 透传(无新 adapter/mapper);账号登录走 OAuth2 device flow(`authScheme=grok_build_oauth`,`accounts.x.ai/oauth2/{device/code,token}` 浏览器授权 + 自动 refresh,凭证落 `~/.codex-app-transfer/grok-build-oauth.json`,**不依赖本地安装 grok CLI**);出站注入 grok-shell 客户端指纹头(UA / `x-xai-token-auth` / `x-grok-client-*` / `x-grok-model-override` / 会话·请求标识,`forward.rs::injects_grok_build_headers`)避风控。**模型映射补齐**:此前 responses 协议只服务 GPT 兼容上游、未真正用模型映射,本次确认 Codex 的 gpt-5.x 名经 `provider.models` 槽位(default=grok-build)映射为 grok 模型,不透传到上游(否则 cli-chat-proxy 不识别),并加回归测试锁死。模型:grok-build(512k,编码主力)/ grok-composer-2.5-fast(200k)。灰色 provider 默认隐藏、仅本机个人使用。**登录与端到端(/v1/responses)待真机验证**。/ **Grok Build provider integration (xAI grok CLI coding backend, MOC-299)**: integrates the xAI grok CLI (grok-code) coding backend `cli-chat-proxy.grok.com/v1` as a new gray-area provider. The wire is standard OpenAI Responses, reusing `ResponsesPassthroughMapper` for 1:1 passthrough (no new adapter/mapper); account login uses an OAuth2 device flow (`authScheme=grok_build_oauth`, browser auth at `accounts.x.ai/oauth2/{device/code,token}` + auto refresh, credential stored at `~/.codex-app-transfer/grok-build-oauth.json`, **no local grok CLI install required**); outbound injects grok-shell client fingerprint headers (UA / `x-xai-token-auth` / `x-grok-client-*` / `x-grok-model-override` / session·request ids, `forward.rs::injects_grok_build_headers`) to avoid risk control. **Model mapping completed**: the responses protocol previously only served GPT-compatible upstreams and did not truly exercise model mapping; this confirms Codex's gpt-5.x names are mapped via `provider.models` slots (default=grok-build) to grok models rather than passed through (which cli-chat-proxy wouldn't recognize), locked by a regression test. Models: grok-build (512k, coding) / grok-composer-2.5-fast (200k). Gray-area provider, hidden by default, personal use only. **Login and end-to-end (/v1/responses) pending real-machine verification.**
810

911
## v2.4.4

0 commit comments

Comments
 (0)