fix(dev-cli): include prereq checks in envCheck allGood flag#1303
Merged
evanjacobson merged 1 commit intoKilo-Org:improvement/kiloclaw-dev-clifrom Mar 20, 2026
Conversation
The allGood flag was only set to false by the per-service env loop. If .env.local was missing or .vercel/project.json was absent, the function still displayed 'All environment checks passed!' despite having printed an error or warning above. Initialize allGood from envLocalExists && vercelLinked so the final banner correctly reflects all preceding checks. Adds 4 integration tests that exercise envCheck against a temp directory tree and assert the banner matches the actual check results.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 133,279 tokens |
e151f78
into
Kilo-Org:improvement/kiloclaw-dev-cli
1 check passed
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.
Problem
The
envCheckfunction indev/cli/src/commands/env.tsdisplays a false-positive success banner.allGoodis initialized totrue(line 27) and only set tofalseinside the per-serviceforloop (lines 39, 49). The two prerequisite checks —.env.localexistence and.vercel/project.jsonexistence — print errors/warnings but never flipallGoodtofalse.Proof the issue is real
When
.env.localis missing, the function:✗ .env.local missing — run: vercel env pullviaui.error()allGood === trueand printsAll environment checks passed!Same for
.vercel/project.json:ui.warn()fires butallGoodstaystrue.The new tests confirm this — they fail on the original code (3/4 fail) and pass on the fixed code (4/4 pass).
Proof this is not a band-aid
The root cause is in
envCheckitself:allGoodis declared after the prereq checks and doesn't incorporate their results. There is no upstream caller or data source that should be responsible for this — the function owns both the checks and the banner, so the fix belongs here.What changed
dev/cli/src/commands/env.ts: Changedlet allGood = true→let allGood = envLocalExists && vercelLinked, moved before the services filter. This ensures the final banner reflects all checks, not just the service loop.dev/cli/test/env-check.test.ts: Added 4 integration tests that runenvCheckagainst a temp directory tree with controlled filesystem state:.env.local→ banner says "needs attention" (not "passed").vercel/project.json→ banner says "needs attention"All 19 tests pass (15 existing + 4 new).
Fixes review comment: #1142 (comment)