fix(model): resolve CLI exec paths for Windows .cmd shims - #250
fix(model): resolve CLI exec paths for Windows .cmd shims#250WODE25500 wants to merge 2 commits into
Conversation
- Resolve codex/claude/cursor/copilot exec paths via shutil.which at config load so bare npm .cmd shims spawn on Windows (bare 'codex' -> codex.CMD; CreateProcess does not search PATHEXT, so bare names raise WinError 2). - os.symlink uses target_is_directory + copytree/copy2 fallback (OfficeQA on Windows). - Add tests for _resolve_cli_path.
|
The CLI path-resolution change is useful, but the symlink fallback needs to fail closed before merge. In
The current OfficeQA caller generates unique There is also an incomplete redaction path introduced here: Copilot stdout/stderr is passed through |
Address maintainer review on microsoft#250: - prepare_workspace symlink fallback fails closed: re-raise when the destination already exists (lexists), never copytree into an existing dst, and only fall back for the Windows symlink-privilege-not-held error. Prevents a colliding extra_files or duplicate link_dirs entry from mutating source data outside the work dir. - Sanitize Copilot stdout/stderr structurally (mapping-key aware) so JSON objects carrying a token/secret field are redacted even when the value is a quoted mapping (which the string-level redactor missed). - Add tests: symlink privilege fallback, existing/duplicate dst, non-privilege re-raise, and Copilot JSONL secret-field redaction.
|
Yifan Yang (@Yif-Yang) — thank you for the thorough review and guidance! I've addressed the feedback:
Thanks again for the detailed review! |
Cross-platform exec fixes for the model backends.
Verified: _resolve_cli_path('codex') -> codex.CMD on Windows; targeted tests pass.