Skip to content

[codex] Fix Codex CLI detection for mise-managed Node installs - #1

Closed
iambinlin wants to merge 1 commit into
mainfrom
fix/codex-mise-detection
Closed

iambinlin wants to merge 1 commit into
mainfrom
fix/codex-mise-detection

Conversation

@iambinlin

@iambinlin iambinlin commented May 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix false-negative local Codex CLI detection in CC Switch when Codex is installed through a mise-managed Node runtime.

In this setup, codex --version works in the user's terminal, but CC Switch may show not installed or not executable in Settings -> About -> Local Environment Check.

PRD Sketch

PRD sketch

Problem

Tauri GUI apps often start with a reduced PATH compared with an interactive terminal session. When direct execution of codex --version fails, CC Switch falls back to scanning common CLI install locations.

Before this change, the fallback scan covered locations such as:

  • ~/.local/bin
  • ~/.npm-global/bin
  • ~/n/bin
  • Volta
  • fnm
  • nvm

However, it did not cover mise-managed Node installs, such as:

  • ~/.local/share/mise/shims
  • ~/.local/share/mise/installs/node/<version>/bin

As a result, Codex could be installed and usable from the terminal while still being reported as unavailable by CC Switch.

Changes

  • Add mise Node search path support to the local CLI fallback scanner:
    • ~/.local/share/mise/shims
    • ~/.local/share/mise/installs/node/*/bin
  • Reuse the existing path de-duplication helper.
  • Add a unit test covering mise shims and installed Node bin directories.
  • Add a small English PRD sketch asset for the PR description.

Validation

Ran:

cargo fmt
cargo test commands::misc::tests

Result:

  • 14 passed
  • 0 failed

Manual verification:

  • Codex is installed under a mise-managed Node directory.
  • After the fix, CC Switch detects the local Codex version correctly in the About page environment check.

Risk

Low.

This change only extends fallback CLI search paths. It does not change:

  • version parsing
  • remote latest-version checks
  • frontend rendering
  • provider switching
  • config read/write behavior
  • WSL detection behavior

Scope

Affects local tool version detection fallback logic on non-Windows platforms.

Expected impact:

  • Codex installed via mise is now detected correctly.
  • Existing Claude, Gemini, OpenCode, nvm, fnm, Volta, and standard PATH detection behavior remains unchanged.

@iambinlin

Copy link
Copy Markdown
Owner Author

Closed because the intended target is the upstream repository. Superseded by farion1231#2822.

@iambinlin iambinlin closed this May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant