Skip to content

Commit edad526

Browse files
sergio-sisternes-epamSergio SisternesCopilot
authored
fix(runtime): pin codex setup to rust-v0.118.0 for security (#663)
* fix(runtime): pin codex setup to rust-v0.118.0 for security (#662) - Pin CODEX_VERSION to rust-v0.118.0 (latest stable) instead of 'latest' to prevent supply-chain attacks via compromised upstream releases - Update wire_api from 'chat' to 'responses' (the only protocol supported by current Codex releases) - Add user-facing messages about the pin and how to override - Apply same changes to both .sh (Linux/macOS) and .ps1 (Windows) Closes #662 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: address Copilot review feedback (#663) - Use correct CLI syntax: apm runtime setup codex --version <version> - Replace 'pinned to' wording with neutral 'Using Codex $VERSION' - Fix CHANGELOG entry to reference PR #663 instead of issue #662 - Update runtime-compatibility.md to reflect pinned default version Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Sergio Sisternes <sergio.sisternes@epam.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1cf9acb commit edad526

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
### Fixed
1616

17+
- Pin codex setup to `rust-v0.118.0` for security and reproducibility; update config to `wire_api = "responses"` (#663)
1718
- Propagate headers and environment variables through OpenCode MCP adapter with defensive copies to prevent mutation (#622)
1819
### Changed
1920

docs/src/content/docs/integrations/runtime-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ apm runtime setup codex
8383
```
8484

8585
This automatically:
86-
- Downloads the latest Codex binary for your platform
86+
- Downloads Codex binary `rust-v0.118.0` for your platform (override with `--version`)
8787
- Installs to `~/.apm/runtimes/codex`
8888
- Creates configuration for GitHub Models (`github/gpt-4o`)
8989
- Updates your PATH

scripts/runtime/setup-codex.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Setup script for Codex runtime (Windows)
22
# Downloads Codex binary from GitHub releases and configures with GitHub Models
33

4+
# Pin to a known stable release for security and reproducibility (#662).
5+
# Users can override with: apm runtime setup codex --version <version> (e.g. 'latest')
46
param(
57
[switch]$Vanilla,
6-
[string]$Version = "latest"
8+
[string]$Version = "rust-v0.118.0"
79
)
810

911
$ErrorActionPreference = "Stop"
@@ -161,10 +163,12 @@ model = "openai/gpt-4o"
161163
name = "GitHub Models"
162164
base_url = "https://models.github.ai/inference/"
163165
env_key = "$githubTokenVar"
164-
wire_api = "chat"
166+
wire_api = "responses"
165167
"@ | Set-Content -Path $codexConfig -Encoding UTF8
166168

167169
Write-Success "Codex configuration created at $codexConfig"
170+
Write-Info "Using Codex $Version."
171+
Write-Info "Override with: apm runtime setup codex --version <version> (e.g. 'latest')"
168172
} else {
169173
Write-Info "Vanilla mode: Skipping APM configuration"
170174
}

scripts/runtime/setup-codex.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ source "$SCRIPT_DIR/setup-common.sh"
2323

2424
# Configuration
2525
CODEX_REPO="openai/codex"
26-
CODEX_VERSION="latest" # Default version
26+
# Pin to a known stable release for security and reproducibility (#662).
27+
# Users can override with: apm runtime setup codex --version <version> (e.g. 'latest')
28+
CODEX_VERSION="rust-v0.118.0"
2729
VANILLA_MODE=false
2830

2931
# Parse command line arguments
@@ -204,10 +206,12 @@ model = "openai/gpt-4o"
204206
name = "GitHub Models"
205207
base_url = "https://models.github.ai/inference/"
206208
env_key = "$github_token_var"
207-
wire_api = "chat"
209+
wire_api = "responses"
208210
EOF
209211

210212
log_success "Codex configuration created at $codex_config"
213+
log_info "Using Codex $CODEX_VERSION."
214+
log_info "Override with: apm runtime setup codex --version <version> (e.g. 'latest')"
211215
log_info "APM configured Codex with GitHub Models as default provider"
212216
log_info "Use 'apm install' to configure MCP servers for your projects"
213217
else

0 commit comments

Comments
 (0)