Closed
Add fast-fail Copilot CLI startup diagnostic step#43906
Conversation
Adds a new "Probe Copilot CLI readiness" step that runs before "Execute GitHub Copilot CLI" in standard (non-SDK, non-custom) mode. The diagnostic checks: - Binary availability (copilot in PATH) - Version probe (copilot --version) - Auth credentials (COPILOT_GITHUB_TOKEN non-empty, unless BYOK or S2STOKENS mode) On failure it writes an actionable summary to $GITHUB_STEP_SUMMARY and exits with a clear error category (binary, version, auth), stopping the workflow in seconds instead of after 10-24 minutes of agent work. Updates all affected tests, golden files, and recompiles all lock files. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add fast-fail diagnostic for copilot-CLI 0-turn startup failures
Add fast-fail Copilot CLI startup diagnostic step
Jul 7, 2026
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.
Copilot CLI 0-turn startup failures are the dominant production failure family — workflows burn 10-24 minutes of agent work before the failure surfaces. This adds a lightweight preflight step that probes CLI readiness upfront and fails in seconds with an actionable diagnosis.
New step:
Probe Copilot CLI readinessInserted before
Execute GitHub Copilot CLIin standard mode (skipped forengine.commandandengine.copilot-sdk: true). Checks:command -v copilotcopilot --versionCOPILOT_GITHUB_TOKENnon-empty (skipped in BYOK mode whenCOPILOT_PROVIDER_BASE_URLis set, or copilot-requests mode whenS2STOKENS=true)On failure, exits non-zero and writes a categorized error (
binary/version/auth) to$GITHUB_STEP_SUMMARY.Changes
copilot_engine_execution.go— addedcopilotStartupDiagnosticScript,buildCopilotStartupDiagnosticStep(), and updatedGetExecutionSteps()to prepend the diagnostic for standard modethreat_detection_test.go— tightenedwantNotContainscheck to use 6-space-indented permission form, since the diagnostic script now embeds the stringcopilot-requests: writein a commentmake update-wasm-goldenandmake recompile