Skip to content

fix: prevent Copilot CLI PATH fallback#300

Merged
github-actions[bot] merged 3 commits into
mainfrom
spboyer/issue-297-windows-embedded-cli-fallback
May 25, 2026
Merged

fix: prevent Copilot CLI PATH fallback#300
github-actions[bot] merged 3 commits into
mainfrom
spboyer/issue-297-windows-embedded-cli-fallback

Conversation

@spboyer

@spboyer spboyer commented May 25, 2026

Copy link
Copy Markdown
Member

Summary

  • install and resolve Waza's embedded Copilot CLI before constructing the shared SDK client
  • refuse to fall back to an unrelated copilot on PATH when embedded extraction fails
  • validate COPILOT_CLI_PATH overrides and document the bundled CLI behavior

Closes #297

Validation

  • go test ./...
  • cd site && npm run build -- --silent
  • GOOS=windows GOARCH=amd64 go test -c ./internal/embedded -o /tmp/waza-embedded-windows-amd64.test.exe
  • GOOS=windows GOARCH=arm64 go test -c ./internal/embedded -o /tmp/waza-embedded-windows-arm64.test.exe

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 25, 2026 14:15
@github-actions github-actions Bot enabled auto-merge (squash) May 25, 2026 14:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 hardens Copilot SDK execution by ensuring Waza resolves and installs its bundled GitHub Copilot CLI before constructing the shared SDK client, and by refusing to fall back to an unrelated copilot found on PATH when embedded extraction fails. It also adds a COPILOT_CLI_PATH override with validation and documents the bundled-CLI behavior across the docs.

Changes:

  • Resolve Copilot CLI path during shared SDK client construction, validating COPILOT_CLI_PATH and failing fast if the embedded CLI can’t be installed (no PATH fallback).
  • Add an embedded CLI installer (internal/embedded/path.go) that extracts to the user cache and verifies integrity via hashing.
  • Add unit tests for CLI-path selection/error cases and update docs/README to describe the bundled CLI and override behavior.
Show a summary per file
File Description
site/src/content/docs/reference/cli.mdx Documents COPILOT_CLI_PATH and clarifies “no PATH fallback” behavior.
site/src/content/docs/quick-start.mdx Notes the bundled Copilot CLI extraction behavior and when to use COPILOT_CLI_PATH.
README.md Adds bundled Copilot CLI behavior note for users running the copilot-sdk executor.
internal/execution/sdkclient.go Constructs shared Copilot SDK client only after resolving a validated CLI path; refuses PATH fallback on embedded failure.
internal/execution/sdkclient_test.go Adds coverage for embedded CLI path usage, COPILOT_CLI_PATH override, and failure modes.
internal/execution/copilot.go Removes the blank import side-effect for embedded CLI setup (now driven via sdkclient resolution).
internal/embedded/path.go Implements embedded CLI extraction, integrity checking, and atomic install into user cache.
docs/INTEGRATION-TESTING.md Documents bundled CLI behavior for real SDK integration test setup.

Copilot's findings

  • Files reviewed: 8/8 changed files
  • Comments generated: 2

Comment thread internal/execution/sdkclient.go
Comment thread internal/embedded/path.go
spboyer and others added 2 commits May 25, 2026 10:21
Wrap deferred closer.Close() and f.Close() calls in anonymous
functions that explicitly discard the error with _ = to satisfy
the errcheck linter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 25, 2026 14:28
@github-actions github-actions Bot merged commit 9bcc7f7 into main May 25, 2026
7 of 8 checks passed
@spboyer spboyer review requested due to automatic review settings May 25, 2026 14:49
@spboyer spboyer mentioned this pull request Jun 6, 2026
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.

Windows: embedded Copilot CLI silently not extracted; SDK falls through to incompatible copilot on PATH

3 participants