Add environment variable overrides for engine CLI versions#12396
Closed
Add environment variable overrides for engine CLI versions#12396
Conversation
This was referenced Jan 29, 2026
- Add EnvVarCopilotVersion, EnvVarClaudeVersion, and EnvVarCodexVersion constants - Update Copilot installation to use GH_AW_COPILOT_VERSION env var - Update Claude installation to use GH_AW_CLAUDE_VERSION env var - Update Codex installation to use GH_AW_CODEX_VERSION env var - Add GenerateNpmInstallStepsWithEnvOverride function for npm package installs - Update GetBaseInstallationSteps to support environment variable overrides - Modify copilot_srt.go to use environment variable syntax in installer script Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Update test expectations to check for new env var format - Verify GH_AW_COPILOT_VERSION environment variable is used - Ensure fallback to default version works correctly Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
|
@copilot make sure aw_info.json is also updated |
- Update Claude engine test to check for new env var format - Update Codex engine test to check for new env var format - Remove unused fmt import from claude_engine_test.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for overriding agentic engine environment version
Add environment variable overrides for engine CLI versions
Jan 29, 2026
…nt_version - Modified compiler_yaml.go to use env var pattern for agent_version field - For Copilot: agent_version: process.env.GH_AW_COPILOT_VERSION || "default" - For Claude: agent_version: process.env.GH_AW_CLAUDE_VERSION || "default" - For Codex: agent_version: process.env.GH_AW_CODEX_VERSION || "default" - Updated aw_info_agent_version_test.go to check for env var pattern - Explicit versions still use static strings - Custom engines use static strings (no env var support) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Updated in commit 84bc564. The
This matches the installation behavior - when environment variables are set, both the installation steps and the metadata in aw_info.json will use the overridden versions. |
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.
Enables runtime version overrides for Copilot, Claude, and Codex CLI installations via environment variables, allowing version testing without code changes or releases.
Changes
Constants & Configuration
GH_AW_COPILOT_VERSION,GH_AW_CLAUDE_VERSION,GH_AW_CODEX_VERSIONconstantsEngineInstallConfigwith optionalEnvVarNamefieldEngine Installation
GenerateCopilotInstallerSteps()to inject env var with fallbackGenerateNpmInstallStepsWithEnvOverride()for npm-based enginesGetBaseInstallationSteps()to conditionally apply env var patternRuntime Metadata (aw_info.json)
agent_versionfield to use environment variable pattern when no explicit version is configuredagent_version: process.env.GH_AW_COPILOT_VERSION || "0.0.395"agent_version: process.env.GH_AW_CLAUDE_VERSION || "2.1.20"agent_version: process.env.GH_AW_CODEX_VERSION || "0.92.0"Version Resolution Priority
engine.version)Example
Setting
GH_AW_COPILOT_VERSION=0.0.400in repository variables generates:Without the variable set, defaults to
0.0.395.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.