Skip to content

fix(aicli): handle detection for GitHub Copilot CLI version#48

Merged
ashishkurmi merged 3 commits intostep-security:mainfrom
shubham-stepsecurity:sm/feat/migrate
Apr 28, 2026
Merged

fix(aicli): handle detection for GitHub Copilot CLI version#48
ashishkurmi merged 3 commits intostep-security:mainfrom
shubham-stepsecurity:sm/feat/migrate

Conversation

@shubham-stepsecurity
Copy link
Copy Markdown
Member

What does this PR do?

Type of change

  • Bug fix
  • Enhancement
  • Documentation

Testing

  • Tested on macOS (version: ___)
  • Binary runs without errors: ./stepsecurity-dev-machine-guard --verbose
  • JSON output is valid: ./stepsecurity-dev-machine-guard --json | python3 -m json.tool
  • No secrets or credentials included
  • Lint passes: make lint
  • Tests pass: make test

Related Issues

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves AI CLI tool detection by preventing false positives for the GitHub Copilot CLI when a VS Code extension shim is present on PATH and responds to --version with an installation prompt.

Changes:

  • Add a VerifyFunc for github-copilot-cli that rejects the “not installed / install prompt” output and requires a version-like token.
  • Add unit tests covering rejection of the install prompt and acceptance/parsing of a real Copilot CLI version.
  • Adjust cleanVersionString to return "unknown" when no version token is found.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/detector/aicli.go Adds Copilot-specific verification logic and tightens version parsing fallback behavior.
internal/detector/aicli_test.go Adds tests for Copilot CLI detection behavior (shim prompt vs real version).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/detector/aicli.go Outdated
@ashishkurmi ashishkurmi merged commit 06ee45b into step-security:main Apr 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants