fix(contrib/windows): the supervised bridge runs headless, not in a terminal tab - #121
Open
erwin-wee wants to merge 1 commit into
Open
fix(contrib/windows): the supervised bridge runs headless, not in a terminal tab#121erwin-wee wants to merge 1 commit into
erwin-wee wants to merge 1 commit into
Conversation
…erminal tab Register-CollieTask set Execute=powershell.exe under an Interactive principal, which allocates a real console. On Windows 11 the default console host is Windows Terminal, so the bridge that is supposed to run in the background instead surfaces as a tab titled with the full powershell.exe path — and closing that tab kills the bridge, after which the restart policy brings the tab straight back a minute later. Wrapping the same command in `conhost.exe --headless` gives it a pseudoconsole with no window. Nothing else moves: the launcher is still the powershell child, so the PID that _exec-bridge records in the pidfile and the command-line check in Stop-RecordedCollieProcesses both still see what they expect, and taskkill /T reaches bun through it. Falls back to the bare action if conhost.exe is missing.
erwin-wee
force-pushed
the
windows-headless-task
branch
from
August 20, 2026 03:03
9c3c940 to
9f46026
Compare
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.
What
Register-CollieTaskregisters the supervised bridge asExecute = powershell.exeunder anInteractive principal. That allocates a real console, and on Windows 11 the default console host is
Windows Terminal — so the bridge that is meant to run in the background shows up as a tab titled
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.It isn't only cosmetic. The tab owns the launcher, so closing it kills the bridge;
RestartCount 999/
RestartInterval PT1Mthen brings both the bridge and the tab back about a minute later. From theoperator's side it reads as a terminal window that refuses to stay closed.
This wraps the same command in
conhost.exe --headless, which runs it on a pseudoconsole with nowindow at all.
Why this shape
conhost --headlessexecs powershell as its child, so the$PIDthat
_exec-bridgewrites to$script:PidFileis still the powershell process, theContains($controlScript)/Contains("_exec-bridge")check inStop-RecordedCollieProcessesstill matches it, and
taskkill /PID … /T /Fstill reaches bun through it. conhost exits with itschild, so Task Scheduler's restart policy is unaffected.
-WindowStyle Hidden— the console is allocated before the script can hide it, so itflashes.
Hiddensetting — that hides the task from the Task Scheduler UI, not thewindow.
bridge runs; the Interactive principal is load-bearing for reaching Herdr's socket in the user
session and resolving
bunfrom the user's PATH.conhost.exeis absent.Verified on
Windows 11 Pro 26200, Windows Terminal 1.24, Herdr plugin
herdr.collie, PowerShell 5.1 launcher.Before:
WindowsTerminal.exe → powershell.exe → bun.exewith a visible tab. After:conhost.exe --headless → powershell.exe → bun.exe, no window handle on any process in the chain,bridge reachable as usual.
contrib\windows\collie-ctl.test.ps1passes (OK Windows lifecycle tests); two assertions added for the wrap.Notes
CLAUDE.md, no version bump and noCHANGELOG.mdentry — fork PR. Suggested line if you wantone:
Fixed — Windows: the supervised bridge no longer opens a Windows Terminal tab (conhost --headless)..adr/entry if you think "why not-WindowStyle Hidden/ S4U" is the kind ofquestion that will come back; I left the reasoning as a comment at the registration site instead.