Skip to content

[Bug] Windows desktop app flashes visible console windows for internal git/taskkill children, even while idle #34266

Open

Description

@coka19911115

Summary

Codex Desktop on Windows repeatedly spawns short-lived internal console child processes. Each spawn allocates a visible console window that flashes on screen and disrupts typing/window focus.

This occurs while the app is running in the background, including when it is fully idle with no chat/task session open.

Environment

  • Codex desktop app: 26.715.31925 (also observed on 26.715.31251)
  • codex-cli: 0.144.5
  • OS: Windows 11 Home 10.0.26200
  • Workspace: large local Git repository
  • Evidence captured: 2026-07-20 (Asia/Tokyo), via Win32_Process polling

Observed behavior

A 90-second process-creation trace captured approximately 110 process spawns originating from ChatGPT.exe:

  • 38 × taskkill.exe /pid <pid> /t /f
  • 21 × git.exe, including commands such as:
    • git config --null --get core.fsmonitor
    • git -c core.hooksPath=NUL -c core.fsmonitor= hash-object -- <file>
  • Approximately 55 × conhost.exe children associated with those console processes

The git hash-object calls appear to be per-file change probing, so activity in a busy repository—or another tool writing files in the workspace—multiplies the flash frequency. Several black console windows can pop up per minute and disappear within a fraction of a second.

The taskkill /t /f volume also suggests process-tree cleanup is being performed through a console helper rather than a windowless Win32 process/job-object path.

Steps to reproduce

  1. Open Codex Desktop on Windows with a medium-sized or larger local Git repository.
  2. Leave the app running; no active chat/task session is required.
  3. Observe process creation using Win32_ProcessStartTrace, Win32_Process polling, Process Monitor, or Process Explorer.
  4. Observe recurring chains originating from the desktop app:
    • ChatGPT.exe -> git.exe -> conhost.exe
    • ChatGPT.exe -> taskkill.exe -> conhost.exe
  5. Observe visible black console-window flashes and occasional typing/window-focus disruption.

Expected behavior

Internal housekeeping children such as Git probes and process-tree cleanup should be spawned without visible console windows, for example:

  • Win32 CREATE_NO_WINDOW (0x08000000) in CreateProcess creation flags, or
  • Electron/Node child-process options such as windowsHide: true, with no console inheritance.

Process-tree cleanup should also avoid repeated visible taskkill /t /f helper launches where practical (for example, using TerminateProcess and/or Windows job objects).

Impact

  • Repeated visible black-window flashes
  • Disrupted typing and window focus
  • Frequency increases with repository activity and repository size
  • Reproduces even when Codex is idle in the background with no task open

Related issue

Possibly related to #17229, which reports repeated git.exe/conhost.exe spawning and orphaned processes. This report specifically adds Win32 process-trace evidence for visible console allocation, frequent taskkill.exe child processes, per-file hash-object probing, focus disruption, and idle-background reproduction.

Activity

  1. added
    bug
    app
    windows-os
    on Jul 20, 2026
  2. suiyuebaobao commented on Jul 22, 2026

    @suiyuebaobao

    The internal Git/taskkill child-process churn and visible console flashes here are part of the same Git-backed desktop integration surface that this workaround disables.

    I published a single-file Windows launcher for the original Microsoft Store/MSIX Codex app:

    It starts Codex with a process-scoped GIT_DIR=NUL. On my machine, the stable trace changed from 247 new git.exe and 137 new taskkill.exe processes per 10 seconds to 0 and 0 over 15 seconds; WMI Provider Host fell from about 6.6% to 0.9%.

    Usage: fully exit Codex from the Windows system tray, then run the script.

    This is an unofficial workaround, not an upstream fix. It deliberately disables or limits Review, Changes, branch detection, commit, and other Git-backed Codex features. It does not patch Codex, modify repositories or Git configuration, write system environment variables, require elevation, terminate processes, or remove chat history. Launching Codex normally restores Git integration.

  3. tomiibestpartner-sketch commented on Jul 25, 2026

    @tomiibestpartner-sketch

    I can reproduce the same user-visible symptom on Windows Codex desktop 26.721.4979.0. In my case, the internal child is PowerShell rather than git/taskkill:

    ChatGPT.exe -> codex.exe -> powershell.exe

    The observed non-interactive PowerShell process collects CPU/memory information through Win32_PerfFormattedData_PerfProc_Process and does not include -WindowStyle Hidden. Its visible console window briefly takes foreground focus and interrupts voice dictation.

    This supports the same root issue: all internal Windows console children should be created windowless from process creation, including PowerShell-based resource collection. Closing #35301 as a duplicate so the PowerShell-specific evidence is consolidated here.

  4. 71ming commented on Sep 23, 2026

    @71ming

    I can reproduce this issue on Codex Desktop for Windows version 26.915.4065.0.

    While Codex is open and working with a local Git repository, visible console windows periodically flash and disappear.

    I monitored process creation and confirmed these process chains:

    ChatGPT.exe -> git.exe -> conhost.exe
    

    Examples of commands launched directly by ChatGPT.exe include:

    git diff --cached --name-only
    git config --get core.fsmonitor
    git remote show origin
    

    The flashing occurs during normal background Git status/remote refreshes, sometimes while no Git command was explicitly requested. Closing Codex stops the behavior.

    This began after repository ownership was repaired, which allowed Codex Git integration to work normally again. The repository permissions are now correct, so reverting the ownership change is not a safe workaround.

    Expected behavior: background Git processes should be launched with CREATE_NO_WINDOW or equivalent hidden-window flags.

  5. brick0808 commented on Oct 2, 2026

    @brick0808

    Comment for #34266

    Adds: regression on 26.930.2377.0 + source-level root cause

    I hit the exact same behavior described here, and I was able to narrow it down to a
    specific line in app.asar. Posting here rather than opening a duplicate.

    This is a regression on the latest Store build

    Package OpenAI.Codex 26.930.2377.0, installed 2026-10-02 14:07 local
    codex-cli 0.160.0
    OS Windows 11 Home, Insider Preview 10.0.26220
    Observed 2026-10-02, after the 14:07 update

    The flashing did not occur on the previously installed build on this machine. I no
    longer have the previous build to diff against, so I can't prove what changed — but the
    symptom started exactly at this update.

    Window-handle level evidence

    Process tracing alone can't distinguish a real console window from a headless one
    (CREATE_NO_WINDOW still creates a conhost.exe). So I also polled EnumWindows at 1 ms
    and resolved each new window to its owning process. Actual visible windows:

    15:37:24.306 | WindowsTerminal.exe | CASCADIA_HOSTING_WINDOW_CLASS | Windows Terminal
    15:37:24.428 | git.exe             | PseudoConsoleWindow
    

    20 such pairs in ~21 s. (Windows Terminal is the default terminal host here, which is why
    the flash is a Terminal window rather than a classic black conhost window.)

    Process trace over the same window:

    ChatGPT.exe (pid 44536)
      └─ git.exe    x41   (32 s burst)
           └─ conhost.exe
                └─ git.exe
    

    Matches this report. One difference worth noting: the git calls are bursty, not
    continuous
    — 41 calls in a 32-second burst while git-related UI was being opened, then
    zero while the app sat idle. That matches "activity multiplies the flash frequency",
    and suggests the trigger is the branch/diff UI rather than a background timer.

    Likely root cause in app.asar

    In the main-process bundle there is a generic spawn helper:

    function oi({args:e, ..., detached:l=!1, windowsHide:u, ...}){
      let _ = {cwd:n, detached:l, windowsHide:u, env:h, stdio:[...]};
      return spawn(<resolved path>, m, _);
    }

    windowsHide is forwarded from the caller with no default, so callers that omit it get
    windowsHide: undefined — which is falsy, so Node does not pass CREATE_NO_WINDOW.

    The git call path appears to omit it. Notably, the helper commands in the same file do
    set it:

    spawnSync(where.exe, [`$PATH:${e}`], {env:t, windowsHide:!0, encoding:'utf8'})  // locating git
    spawn     (taskkill.exe, [...],     {env,   windowsHide:!0})                  // killing git
    spawn     (git.exe,     [...],      {env,   windowsHide: undefined})         // running git

    So the helpers that look for and kill git hide their windows, while the process that
    actually runs git does not. Identifiers are minified and build-specific, so treat this as
    a pointer rather than a patch.

    If that reading is right, the one-line fix is to default it, e.g.
    windowsHide:u=!0 in the helper, or pass windowsHide:true at the git call site.

    Reproduction

    1. Install OpenAI.Codex 26.930.2377.0 on Windows, open a Git repo
    2. Open git-related UI (branch bar / diff panel / switch project)
    3. Poll Win32_ProcessStartTrace for git.exe with parent pid = the ChatGPT.exe main process
    4. Poll EnumWindows for CASCADIA_HOSTING_WINDOW_CLASS / PseudoConsoleWindow
    5. Observe the flash correlates 1:1 with the git.exe bursts

    Happy to provide the raw traces (process tree + window log) if useful.

  6. cilantro7 commented on Oct 10, 2026

    @cilantro7

    补充当前 Windows 桌面版复现证据(2026-10-10):

    已安装并正在运行的 Microsoft Store 包版本为 OpenAI.Codex 26.1002.7124.0,通过 Get-AppxPackage 和运行中的 ChatGPT.exe 路径交叉确认。打开应用后反复出现标题为 Git 可执行程序的可见 Windows Terminal 窗口,影响正常使用。

    只读短时采样捕获到:

    ChatGPT.exe → git.exe → conhost.exe
    

    多个 git status 和 git config 进程由 ChatGPT.exe 直接启动,没有经过 MCP 或 CodeGraph。另一次约 15 秒的采样,在应用直接启动的 Git 进程存在时,同时观察到其 conhost.exe 子进程,以及窗口句柄非零、标题包含 Git 的 WindowsTerminal.exe 窗口。窗口与 Git 的关联为时间上的共同观察,尚未通过逐窗口归属追踪证明一一对应。

    本机也存在 WebStorm 和 CodeGraph 启动的 Git 进程,但上述直接由 ChatGPT.exe 启动的路径可独立观察到。Windows Terminal 配置中未发现将 git.exe 误设为交互式命令行。诊断期间未修改配置、终止进程或修改应用程序。

    这说明当前桌面包仍能复现同类可见窗口现象。未独立检查该版本 app.asar 的启动标志,因此不将遗漏 windowsHide 视为已确认根因。请核对桌面应用直接启动 Git 的路径是否已包含窗口隐藏修复,并明确包含修复的 Windows 桌面包版本。

    反馈由用户明确授权提交;已省略用户名、项目路径、仓库地址、完整命令参数和登录信息。

  7. hugotomita1201 commented on Nov 3, 2026

    @hugotomita1201

    Still happening on OpenAI.Codex 26.1027.3384.0 (Windows 11 Pro 10.0.26200), and with Windows Terminal set as the default terminal it is worse than a flash: each child becomes a Windows Terminal tab or window.

    What a process-start log on this machine shows:

    • The children come from the app's Node service process (ChatGPT.exe --type=utility --utility-sub-type=node.mojom.NodeService): gh.exe api graphql ... (pull request status), git.exe (status, ls-files, config --get core.fsmonitor, diff) and taskkill.exe /pid <pid> /t /f.
    • None of them is started hidden, so Windows gives each a new visible console. Because the default terminal is Windows Terminal, Windows hands each console to it (OpenConsole.exe -Embedding), and it opens a tab, or a new window.
    • In one 2-minute burst, the Windows Terminal tab count went from 2 to 13, then 8 new windows opened. Each new tab or window came within about 5 seconds after one of these gh.exe or git.exe starts. On this machine, a burst of 15-20 terminal tabs drops the mouse pointer to about 1 frame per second until the tabs close.
    • The app spawned nothing while it sat idle overnight. The bursts came while it was in use.

    The fix suggested above would cover this too: windowsHide: true (or CREATE_NO_WINDOW) on every internal child, including the gh calls.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions