fix(run): prioritize APM-managed runtimes and pin codex compatibility (#605)#651
Closed
sergio-sisternes-epam wants to merge 4 commits intomicrosoft:mainfrom
Closed
Conversation
…microsoft#605) - _detect_installed_runtime() now checks ~/.apm/runtimes/ before system PATH, preventing system stubs from shadowing APM-managed binaries - Pin codex setup scripts to v0.1.2025051600 (last version supporting wire_api="chat" for GitHub Models compatibility) - Add warnings in codex setup scripts about GitHub Models limitation - Add 6 unit tests covering runtime detection priority scenarios Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes apm run start runtime selection by prioritizing APM-managed runtimes over system PATH lookups, and pins the Codex runtime installer to a GitHub Models-compatible Codex version to avoid breaking API incompatibilities.
Changes:
- Update
_detect_installed_runtime()to check~/.apm/runtimes/before usingshutil.which()on PATH. - Pin Codex setup scripts (bash + PowerShell) to
0.1.2025051600and add compatibility warnings for GitHub Models. - Add unit tests covering the new runtime detection priority logic.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/apm_cli/core/script_runner.py |
Implements APM-managed runtime precedence over PATH during runtime detection. |
tests/unit/test_script_runner.py |
Adds unit tests for runtime detection priority behavior. |
scripts/runtime/setup-codex.sh |
Pins default Codex version and logs warnings about GitHub Models compatibility. |
scripts/runtime/setup-codex.ps1 |
Pins default Codex version and logs warnings about GitHub Models compatibility on Windows. |
CHANGELOG.md |
Adds Unreleased “Fixed” entries describing the runtime detection change and Codex pin. |
…icrosoft#605) - Use shutil.which(name, path=runtime_dir) for APM-managed runtime detection, handling .exe suffix on Windows via PATHEXT automatically - Add test for Windows .exe binary detection in APM runtimes dir - Update changelog entries to reference PR microsoft#651 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
CI Integration Failure — Root Cause AnalysisFailing job
Root causeThe codex setup script pins Additional discovery
Fix plan
|
The codex version pin (0.1.2025051600) references a deleted tag — the openai/codex project removed all old-format releases. This caused CI integration tests to fail (tar receives an HTML 404 page instead of a binary). Revert setup-codex.sh and setup-codex.ps1 to main's CODEX_VERSION=latest to unblock this PR. The version pinning concern will be addressed in a separate issue and PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 10, 2026
Open
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes runtime detection priority so APM-managed binaries in
~/.apm/runtimes/are checked before system PATH. Also fixes Windows.exedetection.Closes #605.
Changes
src/apm_cli/core/script_runner.py_detect_installed_runtime()now usesshutil.which(name, path=str(runtime_dir))to check~/.apm/runtimes/before falling back to system PATH{name}.exein runtimes dir whenshutil.whichfailsTests
TestDetectInstalledRuntimeclass with 7 test cases including Windows.exescenarioCHANGELOG
### Fixedin[Unreleased]Closing in favor of #608, which covers the same #605 fix plus additional runtime improvements. The core detection priority fix is equivalent.