Commit Graph

1 Commits

  • fix(codex): add multi-platform CLI discovery and static gpt-5.5 template fallback (#3382)
    * fix(codex): add multi-platform CLI discovery and static gpt-5.5 template fallback for model catalog generation
    
    When cc-switch generates a Codex model catalog for third-party providers,
    it needs the gpt-5.5 model definition as a template. Previously it relied
    on either ~/.codex/models_cache.json (only exists when Codex has connected
    to OpenAI) or running 'codex debug models --bundled' (fails when codex
    is not on the Tauri app's PATH, common in macOS GUI environments).
    
    This commit adds a three-tier fallback:
    1. Try 'codex' from PATH, then platform-specific common paths
       (/opt/homebrew/bin/codex, /usr/local/bin/codex, etc.)
    2. If all CLI attempts fail, use a compile-time embedded gpt-5.5
       template (extracted from codex 0.135.0 bundled models)
    
    Also adds tests for the static template validity and CLI candidates.
    
    * fix(codex): discover user node codex installs
    
    ---------
    
    Co-authored-by: Jason <farion1231@gmail.com>