Detect runtime for copilot-sdk installs from engine.copilot.command via runtime manager#36653
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
copilot-sdk installs from engine.copilot.command
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in |
copilot-sdk installs from engine.copilot.commandcopilot-sdk installs from engine.copilot.command via runtime manager
There was a problem hiding this comment.
Pull request overview
This PR updates Copilot engine installation step generation so that when copilot-sdk: true is enabled, the workflow emits a runtime-specific Copilot SDK install step based on engine.copilot.command (including env ... <cmd> wrappers), instead of always assuming Node/npm.
Changes:
- Added runtime detection for
engine.copilot.commandand mapped it to language-specific Copilot SDK install commands (Node/Python/Go/Rust/.NET/Java). - Ensured SDK install steps are still emitted even when a custom Copilot command is provided (and in firewall mode, alongside AWF installation).
- Expanded unit tests to cover runtime-specific SDK installation selection and firewall coexistence.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/copilot_engine_installation.go | Adds runtime-aware SDK install step generation and integrates it into Copilot engine installation flow. |
| pkg/workflow/copilot_engine_test.go | Updates existing assertions and adds coverage for runtime-specific SDK install steps with/without firewall. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
| var steps []GitHubActionStep | ||
| if len(sdkInstallStep) > 0 { | ||
| steps = append(steps, sdkInstallStep) | ||
| } | ||
| return BuildNpmEngineInstallStepsWithAWF(steps, workflowData) | ||
| } |
When
copilot-sdk: trueis enabled, SDK installation previously assumed npm/Node even for customengine.copilot.commandruntimes. This change infers runtime from the command and emits the matching SDK install command with pinned SDK versioning and safe install flags.Runtime-aware SDK installation
engine.copilot.command(includingenv ... <cmd>wrappers).commandToRuntime).npm install @github/copilot-sdk@<version>pip install github-copilot-sdk==<version>go get github.com/github/copilot-sdk/go@v<version>cargo add github-copilot-sdk@<version>dotnet add package GitHub.Copilot.SDK --version <version>com.github:copilot-sdk-java:<version>cargo/rustc,mvnw,ts-node), and defaults unknown runtimes to Node SDK install.Custom command installation flow
engine.copilot.commandno longer suppresses SDK installation whencopilot-sdk: true.Install command policy alignment
--ignore-scripts) and non-mutating (--no-save).DefaultCopilotSDKVersionconsistently across all runtime-specific install commands.Tests
gradle)env-wrapped command detection