Repository navigation
fix(platform): honor CODEXHOST_INSTALL_ROOT on macOS - #457
Conversation
macOS discovery ignored the explicit installation root and always probed the default app locations, unlike Windows and the documented behavior. Resolve an explicit root first and treat it as authoritative.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: BytePioneer-AI/codex-host/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📜 Recent review details🔇 Additional comments (1)
📝 SummarySummary by CodeRabbit
WalkthroughmacOS 的 Codex Desktop 安装发现现在支持自定义安装根目录。未设置自定义根目录时,发现流程继续检查系统和用户应用目录中的默认候选项。新增测试覆盖这些查找路径及无效 bundle 的错误处理。 ChangesmacOS 安装发现
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change honors the macOS installation-root override while retaining bundle validation and default discovery without an override. No merge-blocking issue is identified; merge after normal checks pass. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
On macOS,
discover_codex_desktopignoredCODEXHOST_INSTALL_ROOTand always probed/Applications/{Codex,ChatGPT}.appand~/Applications/.... Windows honors the variable, anddocs/platforms/macos/macos-native-tools.mdsays an explicit root is authoritative. As a result,codexhost,codexhost inspect, and the launcher could not target a Desktop bundle at another path (for example a second copy to run beside the stock app).This change resolves an explicit root first through
inspect_bundleand treats it as authoritative, including when invalid, with no fallback to the default locations. The default-candidate path is unchanged. The lookup is split intodiscover_with_custom_rootso the precedence can be unit-tested without mutating process environment.The bundle identifier and ASAR integrity checks still apply to the explicit root.
Related issues
N/A
Test plan
cargo test -p codexhost-platform --locked: 49 passed, 0 failed. This includes the newexplicit_install_root_is_authoritative_over_default_candidates, which covers: a custom root wins without consulting defaults, defaults still work with no override, and an invalid custom root errors instead of falling back.cargo clippy -p codexhost-platform --all-targets --locked -- -D warnings: clean.cargo fmt --all: applied.CODEXHOST_INSTALL_ROOTpointing at a byte-identical copy of the bundle,codexhost inspectreports the copy asinstall_root(before the change it reported/Applications/ChatGPT.app), and Desktop launched from the copy beside the running stock app.