Skip to content

fix(windows): add windowsHide to remaining git spawn sites#3335

Open
Reese-max wants to merge 1 commit into
thedotmack:mainfrom
Reese-max:fix/windows-hide-git-spawns
Open

fix(windows): add windowsHide to remaining git spawn sites#3335
Reese-max wants to merge 1 commit into
thedotmack:mainfrom
Reese-max:fix/windows-hide-git-spawns

Conversation

@Reese-max

Copy link
Copy Markdown

Problem

On Windows, the worker daemon runs without a console. When a consoleless process spawns a console program (like git.exe) without windowsHide: 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:

File Function
src/services/infrastructure/WorktreeAdoption.ts gitCapture()
src/services/infrastructure/ProcessManager.ts gitQuery()
src/utils/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.

Verification

Diagnosed on Windows 11 with an EnumWindows-based console window monitor: visible git.exe console windows appeared with parent chain git.exe <= bun.exe (worker-service.cjs --daemon) roughly every 20-120s. After patching these three sites in the bundled worker-service.cjs (adding windowsHide) and restarting the worker, the visible flashes from the worker stopped while git polling continued normally (verified via worker.pid heartbeat and port listener).

windowsHide is a no-op on non-Windows platforms, so this change only affects Windows behavior.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XqcTVwxV7jiwGeez1KYjBq

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR suppresses Windows console flashes for remaining git subprocess calls. The main changes are:

  • Added windowsHide: true to ProcessManager.ts git queries used during cwd remap classification.
  • Added windowsHide: true to WorktreeAdoption.ts git capture calls for worktree metadata.
  • Added windowsHide: true to project-name.ts repo-root detection.

Confidence Score: 5/5

Safe to merge with minimal risk.

The changed code only adds windowsHide: true to existing git subprocess options and keeps the same commands, cwd handling, stdio, timeouts, and fallbacks.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The initial contract validation against HEAD~1 failed on the three target functions.
  • The contract validation on the current repository with windowsHide: true passed on lines 45, 196, and 27.
  • The related git-query and runtime test suites completed successfully with exit code 0.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/services/infrastructure/ProcessManager.ts Adds windowsHide: true to the synchronous git query used by cwd remap classification, with no behavior change outside suppressing Windows console windows.
src/services/infrastructure/WorktreeAdoption.ts Adds windowsHide: true to the worktree-adoption git capture helper while preserving timeout, logging, and error handling.
src/utils/project-name.ts Adds windowsHide: true to project-name git repo root detection while keeping the existing fallback behavior when git fails.

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
Loading
%%{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
Loading

Reviews (1): Last reviewed commit: "fix(windows): add windowsHide to remaini..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants