Repository navigation
Description
Problem
On native Windows a black console window flashes into view for a split second, repeatedly, while an agent is working in a Codev terminal in VS Code. It stops when the agent finishes its reply, and stops entirely when VS Code is closed. Reported by the owner 2026-11-18 on Windows 11, codev 3.3.7.
Cause (read from source; the flash itself not yet reproduced under instrumentation)
Tower is started detached, so it has no console. Any console program it starts without windowsHide: true gets a new visible console window for as long as it runs.
The chain that matches the report:
- Each agent tool call posts to Tower (lifecycle reporter), which broadcasts an
overview-changedSSE event (coalesced to about one per 500 ms). - The VS Code Team view refreshes on every SSE event, with no filter, debounce or visibility check:
apps/vscode/src/views/team.ts:11. - Each refresh calls
GET /api/team, which callsgetRepoInfo, which runsexecFileAsync('git', ['remote','get-url','origin'], { cwd })with nowindowsHide:packages/codev/src/lib/team-github.ts:58.
That explains all three observations: only while the agent is processing (tool calls drive the events), only with VS Code open (the extension's Team view drives the requests), a black console window (git.exe's).
Other unhidden spawn sites found in the same sweep
packages/codev/src/agent-farm/servers/tower-cron.ts:286:exec(command)through cmd.exe; a 1-2 s window at each cron run.tower-routes.ts:4047:execAsync('git status --porcelain'), polled every 5 s by the dashboard FileTree (apps/web/src/components/FileTree.tsx:153) while a dashboard tab is open.lib/github.ts:288(gh api rate_limit),tower-routes.ts:2904(codev init),tower-instances.ts:523(npx codev adopt),tower-utils.ts:251(ps, unguarded on Windows).- Children of CLIs the extension launches detached (
apps/vscode/src/commands/spawn.ts:46,tower-starter.ts:48):agent-farm/utils/shell.ts:24,85,143,spawn-worktree.ts:791,utils/config.ts:44. - Extension-host spawns:
apps/vscode/src/clipboard-image.ts:56/59,commands/view-diff.ts,commands/press-cursor-ref.ts:49,review-queue/store.ts:236,commands/approve.ts:360,commands/cleanup.ts:51.
Line numbers are from a sweep and should be re-verified; the Team view chain and the cron site were checked against the files.
Fix shape
- Add
windowsHide: true, or route throughcommandLaunch()(packages/codev/src/lib/platform/windows/command-launch.ts), at every production spawn site reachable from console-less Tower or from the VS Code extension host. - Stop the Team view refreshing on every SSE event: filter to relevant events and/or debounce, and skip when the view is not visible. Consider caching
getRepoInfoper workspace. - Add a guard test so a new unhidden spawn in Tower or the extension fails CI (
windows-shell-spawns.test.tsis the likely home).
Acceptance
- No console window appears while an agent works in a Codev terminal in VS Code on Windows, with the Team view both visible and collapsed.
- No console window at a cron run or with a dashboard tab open.
- POSIX behaviour unchanged.
Related: Spec 1658 (scenario 15 "no console windows flash" covered start Tower, spawn, open terminal and reveal file only; finding M4 is the same mechanism in the codev-ide launcher).
Activity
amrmelsayed commentedon Nov 17, 2026
On it! Working on this with the PIR protocol (plan + dev-approval gates before PR).
[PIR #1919] Plan draft
[PIR #1919] Hide Tower and afx spawn child processes on Windows
[PIR #1919] Hide extension-host child processes on Windows
[PIR #1919] Team view: fetch on SSE only while visible, at most every…
[PIR #1919] Guard: spawns reachable from a console-less process must …
[PIR #1919] Thread: implement phase
[PIR #1919] Plan draft
[PIR #1919] Hide Tower and afx spawn child processes on Windows
[PIR #1919] Hide extension-host child processes on Windows
[PIR #1919] Team view: fetch on SSE only while visible, at most every…
[PIR #1919] Guard: spawns reachable from a console-less process must …
[PIR #1919] Thread: implement phase
[PIR #1919] Review + retrospective
[PIR #1919] Hidden git fetch: refuse credential prompts and time out;…
[PIR #1919] Architect review: hide porch/cleanup graphs, short negati…
Merge pull request #1932 from cluesmith/builder/pir-1919
release notes: backfill Windows follow-ups, test-suite Tower guard, C…
[Bugfix #2015] Test: give the #1919 import-walk test the same sized t…