fix(installer): make engram stop script exit 0 on clean Windows install#935
Open
hansell82 wants to merge 1 commit into
Open
fix(installer): make engram stop script exit 0 on clean Windows install#935hansell82 wants to merge 1 commit into
hansell82 wants to merge 1 commit into
Conversation
On a clean Windows install with no engram process running, `gentle-ai install` aborts with: Error: execute install pipeline: download engram binary: stop running engram processes before upgrade: powershell Stop-Process engram: exit status 1 (output: ) Root cause: engramStopScript() starts with $procs = Get-Process -Name engram -ErrorAction SilentlyContinue On Windows PowerShell 5.1, when no process matches, the suppressed error still sets `$?` to $false. The `if ($procs)` guard never runs and does not reset `$?`, so the script's final state is failure and `powershell.exe -Command` exits 1. stopEngramProcesses() treats that non-zero exit as fatal, aborting the whole pipeline. This is the same clean-install regression class as Gentleman-Programming#815 / Gentleman-Programming#919: those guarded the Stop-Process pipeline, but the trailing exit code still leaks. Fix: append `exit 0` to the script. The stop step is best-effort (all calls use -ErrorAction SilentlyContinue) and the WARNING surfacing path is unchanged, so forcing a success exit on a clean no-op is correct. Verified on Windows 11 / PowerShell 5.1: built from this branch and `gentle-ai install --agents claude-code` now completes (65/65 checks). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Changesengram PowerShell stop script exit code
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Summary
On a clean Windows install (no
engramprocess running),gentle-ai installaborts before configuring any agent:
Because
engramis auto-added as a dependency of every agent install, thisblocks the installer entirely on Windows — even
--components skillspulls it in.Root cause
engramStopScript()(ininternal/components/engram/download.go) begins with:On Windows PowerShell 5.1, when no process matches, the suppressed error
still sets
$?to$false. Theif ($procs)guard is skipped and does notreset
$?, so the script's final automatic status is failure andpowershell.exe -NoProfile -NonInteractive -Command <script>exits1with emptyoutput.
stopEngramProcesses()treats any non-zero exit as fatal and aborts thewhole pipeline.
This is the same clean-install regression class as #815 / #919. Those fixes added
the
if ($procs)pipeline guard, but the trailing exit code still leaks on aclean no-op.
Minimal reproduction (Windows PowerShell 5.1)
Fix
Append
exit 0to the script. The stop step is best-effort — every call alreadyuses
-ErrorAction SilentlyContinue, and theWARNING:surfacing path (parsedfrom stdout by
stopEngramProcesses) is unchanged — so forcing a success exit ona clean no-op is correct.
Verification
Built from this branch on Windows 11 / PowerShell 5.1 and ran
gentle-ai install --agents claude-code --scope global— install now completeswith 65/65 verification checks passing (engram, gga, SDD, skills, theme).
🤖 Generated with Claude Code
Summary by CodeRabbit