fix(agent-core): hide console window when running hooks on Windows - #1466
Merged
Conversation
Pass windowsHide:true when spawning the hook process so a visible console no longer flashes and steals focus on Windows. The Bash-tool path was already hardened (KAOS buildLocalSpawnOptions); the hook runner missed the flag even though its own taskkill helper already set it. Extract the spawn options into a pure builder and add a regression test asserting windowsHide, mirroring the existing KAOS spawn-options test. Relates to #1298.
🦋 Changeset detectedLatest commit: bc268e8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
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.
Related Issue
Relates to #1298.
Problem
On Windows, every hook command spawned a visible console window (mintty / Git Bash) that briefly stole foreground focus. This is the same root cause reported in #1298, but in the hook runner path, which the earlier fix did not cover. The Bash tool path was already hardened with
windowsHide: true; the hook runner's processspawnwas missing thewindowsHideflag, even though its owntaskkillhelper already passed it.What changed
Pass
windowsHide: truewhen spawning the hook process, so hooks run silently without flashing a console window on Windows. The spawn options were extracted into a pure builder so the flag can be covered by a regression test, mirroring the existing KAOS spawn-options regression test.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. (No doc update needed — a bug fix restoring expected behavior.)