Codex IDE sidebar Git-origin polling triggers severe Windows PID 4 Section-handle growth

Open
#35,775 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
git, vscode

Research direction

Start by tracing the sidebar_workspace_task_groups_task_dirs request and the repeated Git commands listed in the report, using sanitized logs or a controlled Windows reproduction. Done means identifying the refresh or duplication cause, then establishing bounded, cached, cancellable Git-origin polling or a supported mitigation for inactive or historical task directories.

Written by the indexing model from the issue text.

Description

bug extension performance windows-os

Bug: Codex IDE sidebar Git-origin polling triggers severe Windows PID 4 Section-handle growth

Summary

On one Windows workstation, enabling the OpenAI Codex VS Code extension causes
a continuous storm of short-lived git.exe and conhost.exe processes. This
correlates with severe accumulation of unnamed Section handles in Windows PID
4 (System), eventually causing system-wide resource exhaustion.

A controlled uninstall/reinstall test reproduced the problem on two Codex
extension builds. Removing Codex stops both the Git process storm and sustained
PID 4 handle growth. Freshly reinstalling Codex makes both return.

Environment

  • Operating system: Windows 11 x64
  • VS Code: 1.130.0
  • Git for Windows installed
  • Original affected Codex extension: openai.chatgpt@26.721.30844
  • Freshly reinstalled Codex extension: openai.chatgpt@26.721.41059
  • Repositories include a relatively large set of historical local/network
    workspaces associated with prior Codex threads.

Reproduction and controlled results

Codex installed and active

Before uninstall:

  • Repeated Git operations appeared every few seconds.
  • Representative commands:
    • git -c core.hooksPath=NUL -c core.fsmonitor= for-each-ref --count=100 ...
    • git config --null --get core.fsmonitor
    • git -c core.hooksPath=NUL -c core.fsmonitor= rev-parse --abbrev-ref HEAD
    • git -c core.hooksPath=NUL -c core.fsmonitor= remote
  • Codex logs identified the repeating request as:
    • requestKind=git-origins
    • source=sidebar_workspace_task_groups_task_dirs
  • PID 4 handle growth repeatedly measured approximately 15–22 handles/second.
  • One 20-second sample measured +357 handles (17.85 handles/second).
  • A three-minute sample observed 474 new Git processes and 360 new conhost
    processes.

Disabling VS Code's built-in Git integration did not stop the behavior.
Removing GitLens and a third-party Claude/Codex history extension also did not
stop it.

Codex uninstalled

After removing openai.chatgpt and confirming that no codex.exe process was
running:

  • Three consecutive one-minute PID 4 rates were:
    • -0.16 handles/second
    • -0.54 handles/second
    • +2.68 handles/second
  • Zero Git processes were observed.
  • An extended 15-minute test averaged 1.02 PID 4 handles/second.
  • Zero Git processes were observed throughout that 15-minute window.
Fresh Codex reinstall

After installing openai.chatgpt@26.721.41059:

  • PID 4 increased by 1,472 handles in 60 seconds: 24.53 handles/second.
  • 172 short-lived Git processes were observed in the same minute.
  • The Git commands reproduced the same core.hooksPath=NUL,
    core.fsmonitor=, for-each-ref, rev-parse, and remote pattern.
  • The dominant direct parents were active VS Code extension-host processes.
  • PID 4 had accumulated more than 624,000 handles when checked.

Kernel/object analysis

Read-only Sysinternals Handle inventories and LiveKD analysis established that
the PID 4 growth is almost entirely unnamed Section handles. Representative
objects had:

  • object type: Section
  • no name
  • access mask: 0x000f001f
  • one PID 4 handle
  • pointer count: 32767
  • one mapped view
  • one 4 KB committed pagefile-backed page

The evidence supports the Codex Git-process storm as the repeatable trigger. It
does not establish that Codex itself owns or directly leaks the kernel objects;
the Windows process-creation/teardown path may retain them after the rapid
short-lived process launches.

Expected behavior

The sidebar should not continuously rescan the Git origins of a large
historical task-directory set. Background repository discovery should be
bounded, cached, cancellable when the view is inactive, and should not create
hundreds of processes per minute.

Actual behavior

The Codex sidebar repeatedly scans historical task directories, creating
hundreds of short-lived Git/conhost processes and driving sustained PID 4
Section-handle growth until the workstation approaches resource exhaustion.

Requested investigation

Please investigate:

  1. The refresh/invalidation loop behind
    sidebar_workspace_task_groups_task_dirs.
  2. Whether Git-origin discovery is duplicated across multiple VS Code
    extension hosts/windows.
  3. Whether repository results can be cached or concurrency/rate limited.
  4. Whether the internal sidebar Git/PR-origin functionality can be disabled
    through a supported setting as a mitigation.
  5. Why uninstall/reinstall preserves or reconstructs the same historical
    task-directory workload.

Sanitized measurements and command lines can be supplied. Full logs, ETL
traces, and live-kernel dumps exist but contain private workstation and
repository information and should not be uploaded publicly.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.