Add CI smoke test for CLI launch + --dry-run flag + fix isOnPath isolation#200
Merged
Alan-Jowett merged 4 commits intomainfrom Apr 7, 2026
Merged
Conversation
…isolation Agent-Logs-Url: https://github.com/microsoft/PromptKit/sessions/4a201d67-41ca-45a4-8698-27f187f2ce41 Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>
…heck, JSON args parsing in tests, workflow permissions Agent-Logs-Url: https://github.com/microsoft/PromptKit/sessions/4a201d67-41ca-45a4-8698-27f187f2ce41 Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CI smoke test for CLI launch
Add CI smoke test for CLI launch + --dry-run flag + fix isOnPath isolation
Apr 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds CI coverage for the CLI launch path and introduces a --dry-run mode to validate spawn invocation formatting without requiring a real LLM CLI, while also improving PATH detection isolation by removing reliance on which/where.
Changes:
- Reworked CLI PATH detection to scan PATH directories directly (no external
which/wheredependency). - Added
--dry-runflag to print the exact spawn command/args and exit without launching. - Added regression tests + a GitHub Actions smoke-test job to keep the CLI launch path covered in CI.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
cli/lib/launch.js |
Implements PATH scanning for CLI detection and adds dryRun option to launchInteractive(). |
cli/bin/cli.js |
Exposes --dry-run option and passes it into launchInteractive(). |
cli/tests/launch.test.js |
Adds regression tests for shell: true absence and validates --dry-run output/args structure. |
.github/workflows/validate-manifest.yml |
Triggers workflow on cli/** changes and adds a CLI smoke-test job (Node 20). |
1. isOnPath: filter empty PATH segments to prevent false positives from checking CWD when PATH has empty entries (leading/trailing delimiters or unset PATH). 2. Dry-run cleanup: add force: true to rmSync for reliable cleanup on Windows where read-only files would cause failures. 3. TC-CLI-084: use whitespace-tolerant regex (/shell\s*:\s*true/) instead of exact string match to catch formatting variants. 4. TC-CLI-085: use mkdtempSync for unique temp dirs with cleanup in finally block. Fix bootstrap path extraction to strip known prefix instead of splitting on last space (handles paths with spaces). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
v0.6.0 shipped a broken CLI (
shell: trueinspawn()split the bootstrap prompt into multiple args) with no CI coverage of the launch path. This adds that coverage and the infrastructure to keep it green.Core fixes
isOnPath()rewrite — replacedexecFileSync("which", ...)with directfs.accessSync()iteration over PATH entries. Eliminates the dependency onwhich/wherebeing on PATH (broke test isolation), usesF_OKon Windows whereX_OKis meaningless.TC-CLI-070/TC-CLI-072were silently broken becauserunDetectCli()setPATH=mockDironly, leavingwhichunreachable. Now works correctly sinceisOnPathneeds no shell utilities.New:
--dry-runflagPrints the exact spawn invocation and exits 0 — no LLM CLI required. Used directly in CI smoke steps.
New tests
shell: trueabsent from non-comment lines inlaunch.js— direct regression guard for v0.6.0 bug--dry-runexits 0, args JSON parses to a single bootstrap.md element (verifies no shell-splitting), path is absoluteCI workflow
cli/**to path triggers on bothpushandpull_request.permissions: contents: readat workflow level.cli-smoke-testjob:npm ci && npm test+ explicit--dry-runinvocations forcopilotandclaude.