📋 Pre-flight Checks
📝 Bug Description
Follow-up to #599, which was fixed in #604 for the project-detection path only.
#604 introduced newProjectCommandContext in internal/project, a build-tagged helper that sets SysProcAttr{HideWindow: true} on Windows so git.exe subprocesses no longer allocate a visible console. It was wired into detectGitRootDir and detectFromGitRemote, the two call sites named in #599's evidence chain.
Two other subprocess call sites have the same problem and were deliberately left out of #604's scope:
internal/llm/claude.go:140 — defaultRunCLI spawns the agent CLI (claude, opencode) via exec.CommandContext. On Windows this flashes a console window the same way, and it runs whenever an LLM-backed feature is invoked.
internal/setup/setup.go:36 — runCommand uses exec.Command(...).CombinedOutput(). This one runs during interactive engram setup, where a console window is much less surprising, so it is lower priority.
🔄 Steps to Reproduce
On Windows, trigger any code path that reaches defaultRunCLI (an LLM-backed command) and observe the transient console window, same signature as #599: a conhost.exe / terminal window appearing and vanishing.
✅ Expected Behavior
Subprocesses spawned by Engram on Windows should not allocate a visible console.
❌ Actual Behavior
internal/llm and internal/setup subprocesses still allocate one.
📦 Affected Area
Core (internal/llm, internal/setup)
💡 Proposed Solution
Reuse the pattern from #604 rather than duplicating it. newProjectCommandContext currently lives in internal/project and is unexported, so lifting it into a small shared internal package (something like internal/proc) that project, llm, and setup can all import is probably cleaner than three build-tagged copies.
Note that internal/setup/setup.go wraps the call in a runCommand function variable for test injection, so the helper needs to fit that seam.
📎 Additional Context
Worth keeping the cross-compile check that #604's review established: GOOS=windows GOARCH=amd64 go build ./.... The Windows-only files never compile on macOS/Linux dev machines or in the default CI job, so they can break without anyone noticing until a Windows user reports it.
📋 Pre-flight Checks
status:approvedbefore a PR can be opened📝 Bug Description
Follow-up to #599, which was fixed in #604 for the project-detection path only.
#604 introduced
newProjectCommandContextininternal/project, a build-tagged helper that setsSysProcAttr{HideWindow: true}on Windows sogit.exesubprocesses no longer allocate a visible console. It was wired intodetectGitRootDiranddetectFromGitRemote, the two call sites named in #599's evidence chain.Two other subprocess call sites have the same problem and were deliberately left out of #604's scope:
internal/llm/claude.go:140—defaultRunCLIspawns the agent CLI (claude,opencode) viaexec.CommandContext. On Windows this flashes a console window the same way, and it runs whenever an LLM-backed feature is invoked.internal/setup/setup.go:36—runCommandusesexec.Command(...).CombinedOutput(). This one runs during interactiveengram setup, where a console window is much less surprising, so it is lower priority.🔄 Steps to Reproduce
On Windows, trigger any code path that reaches
defaultRunCLI(an LLM-backed command) and observe the transient console window, same signature as #599: aconhost.exe/ terminal window appearing and vanishing.✅ Expected Behavior
Subprocesses spawned by Engram on Windows should not allocate a visible console.
❌ Actual Behavior
internal/llmandinternal/setupsubprocesses still allocate one.📦 Affected Area
Core (
internal/llm,internal/setup)💡 Proposed Solution
Reuse the pattern from #604 rather than duplicating it.
newProjectCommandContextcurrently lives ininternal/projectand is unexported, so lifting it into a small shared internal package (something likeinternal/proc) thatproject,llm, andsetupcan all import is probably cleaner than three build-tagged copies.Note that
internal/setup/setup.gowraps the call in arunCommandfunction variable for test injection, so the helper needs to fit that seam.📎 Additional Context
Worth keeping the cross-compile check that #604's review established:
GOOS=windows GOARCH=amd64 go build ./.... The Windows-only files never compile on macOS/Linux dev machines or in the default CI job, so they can break without anyone noticing until a Windows user reports it.