fix(windows): add windowsHide to remaining git spawn sites#3335
fix(windows): add windowsHide to remaining git spawn sites#3335Reese-max wants to merge 1 commit into
Conversation
Three git spawn sites were missing windowsHide: true, causing visible console window flashes on Windows when the worker daemon (which has no console) polls git every ~20s: - WorktreeAdoption.ts gitCapture() - ProcessManager.ts gitQuery() - project-name.ts findGitRepoRoot() All other spawn sites in the codebase already pass windowsHide: true (e.g. mcp-client.ts, find-claude-executable.ts, oauth-token.ts); these three were the stragglers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqcTVwxV7jiwGeez1KYjBq
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7b94787d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| encoding: 'utf8', | ||
| timeout: 5000 | ||
| timeout: 5000, | ||
| windowsHide: true |
There was a problem hiding this comment.
Regenerate the shipped worker bundle
This source change does not update the tracked plugin runtime: plugin/scripts/worker-service.cjs still contains the bundled gitQuery call as spawnSync(...,{encoding:"utf8",timeout:5e3}), and the analogous worktree/project-root git probes still omit windowsHide. In installs that use the committed plugin tree/marketplace cache rather than rebuilding from TypeScript, the worker will keep spawning visible git consoles on Windows, so this fix is not actually shipped until the bundle is regenerated and committed.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR suppresses Windows console flashes for remaining git subprocess calls. The main changes are:
Confidence Score: 5/5Safe to merge with minimal risk. The changed code only adds No files require special attention.
What T-Rex did
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Worker as Worker/CLI code
participant Helper as git helper
participant Git as git executable
Worker->>Helper: request repo/worktree metadata
Helper->>Git: spawn git with windowsHide: true
Git-->>Helper: stdout/status
Helper-->>Worker: parsed metadata or null fallback
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Worker as Worker/CLI code
participant Helper as git helper
participant Git as git executable
Worker->>Helper: request repo/worktree metadata
Helper->>Git: spawn git with windowsHide: true
Git-->>Helper: stdout/status
Helper-->>Worker: parsed metadata or null fallback
Reviews (1): Last reviewed commit: "fix(windows): add windowsHide to remaini..." | Re-trigger Greptile |
Problem
On Windows, the worker daemon runs without a console. When a consoleless process spawns a console program (like
git.exe) withoutwindowsHide: true, Windows allocates a visible console window for it. Since the worker polls git every ~20s, this causes constant black window flashes on users' screens.Root cause
Three git spawn sites were missing
windowsHide: true:src/services/infrastructure/WorktreeAdoption.tsgitCapture()src/services/infrastructure/ProcessManager.tsgitQuery()src/utils/project-name.tsfindGitRepoRoot()All other spawn sites in the codebase already pass
windowsHide: true(e.g.mcp-client.ts,find-claude-executable.ts,oauth-token.ts) — these three were the stragglers.Verification
Diagnosed on Windows 11 with an EnumWindows-based console window monitor: visible
git.execonsole windows appeared with parent chaingit.exe <= bun.exe (worker-service.cjs --daemon)roughly every 20-120s. After patching these three sites in the bundledworker-service.cjs(addingwindowsHide) and restarting the worker, the visible flashes from the worker stopped while git polling continued normally (verified via worker.pid heartbeat and port listener).windowsHideis a no-op on non-Windows platforms, so this change only affects Windows behavior.🤖 Generated with Claude Code
https://claude.ai/code/session_01XqcTVwxV7jiwGeez1KYjBq