Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agent/coding_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ def _git(cwd: Path, *args: str) -> str:
capture_output=True,
text=True,
timeout=_GIT_TIMEOUT,
creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0),
)
except (OSError, subprocess.SubprocessError):
return ""
Expand Down
2 changes: 2 additions & 0 deletions tools/checkpoint_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def _run_git(
env=env,
cwd=str(normalized_working_dir),
stdin=subprocess.DEVNULL,
creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0),
)
ok = result.returncode == 0
stdout = result.stdout.strip()
Expand Down Expand Up @@ -450,6 +451,7 @@ def _init_store(store: Path, working_dir: str) -> Optional[str]:
capture_output=True, text=True,
env=init_env, timeout=_GIT_TIMEOUT,
stdin=subprocess.DEVNULL,
creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0),
)
if result.returncode != 0:
return f"Shadow store init failed: {result.stderr.strip()}"
Expand Down
5 changes: 5 additions & 0 deletions tui_gateway/git_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@

import os
import subprocess
import sys
import threading
import time
from collections.abc import Iterable
from concurrent.futures import ThreadPoolExecutor

_GIT_TIMEOUT = 1.5

# Windows: suppress conhost.exe window flashes from git subprocess calls
_CREATE_NO_WINDOW = 0x08000000 if sys.platform == "win32" else 0
_WARM_WORKERS = 8

# How long a "not a git repo" answer stays cached before it's re-probed. Short
Expand All @@ -53,6 +57,7 @@ def run_git(cwd: str, *args: str) -> str:
timeout=_GIT_TIMEOUT,
check=False,
stdin=subprocess.DEVNULL,
creationflags=_CREATE_NO_WINDOW,
)
return result.stdout.strip() if result.returncode == 0 else ""
except Exception:
Expand Down
8 changes: 7 additions & 1 deletion tui_gateway/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def __init__(self, session_key: str, model: str):
# slash_worker runs the Hermes agent → needs provider credentials.
# Tier-1 secrets (gateway/GitHub/infra) are still stripped (#29157).
env=hermes_subprocess_env(inherit_credentials=True),
creationflags=git_probe._CREATE_NO_WINDOW,
)
threading.Thread(target=self._drain_stdout, daemon=True).start()
threading.Thread(target=self._drain_stderr, daemon=True).start()
Expand Down Expand Up @@ -9124,7 +9125,7 @@ def _(rid, params: dict) -> dict:
str(pdf_path), str(out_prefix),
]
try:
res = subprocess.run(argv, capture_output=True, text=True, timeout=120, stdin=subprocess.DEVNULL)
res = subprocess.run(argv, capture_output=True, text=True, timeout=120, stdin=subprocess.DEVNULL, creationflags=git_probe._CREATE_NO_WINDOW)
except subprocess.TimeoutExpired:
return _err(rid, 5028, "pdftoppm timed out (>120s)")
if res.returncode != 0:
Expand Down Expand Up @@ -11155,6 +11156,7 @@ def _(rid, params: dict) -> dict:
# needs provider credentials. Tier-1 secrets still stripped (#29157).
env=hermes_subprocess_env(inherit_credentials=True),
stdin=subprocess.DEVNULL,
creationflags=git_probe._CREATE_NO_WINDOW,
)
parts = [r.stdout or "", r.stderr or ""]
out = "\n".join(p for p in parts if p).strip() or "(no output)"
Expand Down Expand Up @@ -11216,6 +11218,7 @@ def _(rid, params: dict) -> dict:
text=True,
timeout=30,
stdin=subprocess.DEVNULL,
creationflags=git_probe._CREATE_NO_WINDOW,
)
output = (
(r.stdout or "")
Expand Down Expand Up @@ -11675,6 +11678,7 @@ def _list_repo_files(root: str) -> list[str]:
timeout=2.0,
check=False,
stdin=subprocess.DEVNULL,
creationflags=git_probe._CREATE_NO_WINDOW,
)
if top_result.returncode == 0:
top = top_result.stdout.decode("utf-8", "replace").strip()
Expand All @@ -11693,6 +11697,7 @@ def _list_repo_files(root: str) -> list[str]:
timeout=2.0,
check=False,
stdin=subprocess.DEVNULL,
creationflags=git_probe._CREATE_NO_WINDOW,
)
if list_result.returncode == 0:
for p in list_result.stdout.decode("utf-8", "replace").split("\0"):
Expand Down Expand Up @@ -13552,6 +13557,7 @@ def _(rid, params: dict) -> dict:
r = subprocess.run(
cmd, shell=True, capture_output=True, text=True, timeout=30, cwd=os.getcwd(),
stdin=subprocess.DEVNULL,
creationflags=git_probe._CREATE_NO_WINDOW,
)
return _ok(
rid,
Expand Down