Skip to content

Codex Desktop on Windows eagerly runs review-summary Git snapshots on restored workspaces, causing CPU/IO spikes #30820

Description

@Cooper-X-Oak

Summary

Codex Desktop on Windows can trigger severe CPU/IO/memory spikes immediately after launch because the desktop UI restores the last active workspace and eagerly runs review_model / review-summary Git snapshot work against it.

This is not observed with Codex CLI in the same environment. The CLI does not mount the Desktop sidebar/review metadata query stack, while the Desktop app does.

Related but not identical to:

The issue here is the startup/restore trigger chain: restored workspace -> review metadata query -> Git snapshot over thousands of untracked files -> repeated refresh/retry.

Environment

  • OS: Windows
  • Codex Desktop package: OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0
  • Desktop app path: C:\Program Files\WindowsApps\OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0\app\Codex.exe
  • Bundled app-server / CLI reported version: 0.142.5
  • Launch AppID: OpenAI.Codex_2p2nqsd0c76g0!App
  • Workspace involved: a large local workspace under D:\Users\<user>\Documents\Playground
  • Workspace state: Git repo with no valid HEAD / no initial commit, no useful ignore boundary, tens of thousands of files, many untracked files

Observed behavior

Opening Codex Desktop causes the machine to become extremely sluggish. Process monitoring and Desktop logs show Desktop Codex.exe launching Git commands repeatedly.

The important part is that these are not normal git status calls. They are review snapshot commands from Desktop's review metadata path:

source=review_model
requestKind=review-summary
cwd=D:/Users/<user>/Documents/Playground

Examples from Desktop logs:

warning [git] git.command.complete ...
command="git -c core.hooksPath=NUL -c core.fsmonitor= hash-object --no-filters -- <thousands of paths>"
argsCount=5802
cwd=D:/Users/<user>/Documents/Playground
requestKind=review-summary
source=review_model
subcommand=hash-object
warning [git] git.command.complete ...
command="git -c core.hooksPath=NUL -c core.fsmonitor= add -- <thousands of paths>"
argsCount=1026
cwd=D:/Users/<user>/Documents/Playground
requestKind=review-summary
source=review_model
subcommand=add

There was also a failed write-tree from the same path:

warning [git] git.command.complete ...
command="git -c core.hooksPath=NUL -c core.fsmonitor= write-tree"
cwd=D:/Users/<user>/Documents/Playground
requestKind=review-summary
source=review_model
exitCode=1073807364
subcommand=write-tree

A local aggregation of the Desktop log files showed:

total git.command.complete rows: 201
source=review_model: 190
requestKind=review-summary: 185
cwd=D:/Users/<user>/Documents/Playground: 194

The high-cost commands repeat roughly every 15-20 seconds in the captured logs, with hash-object followed by add --.

Startup / restore trigger chain observed

The global state file contains restored workspace state similar to:

electron-saved-workspace-roots:
  - D:\Users\<user>\Practice-Project\202606\Valvekr
  - D:\Users\<user>\Documents\Playground

active-workspace-roots:
  - D:\Users\<user>\Documents\Playground

project-order:
  - D:\Users\<user>\Practice-Project\202606\Valvekr
  - D:\Users\<user>\Documents\Playground

The desktop package's app.asar also shows the path that matches the logs:

  • webview/assets/review-navigation-model-*.js defines a review-summary query with operationSource / source review_model.
  • That query uses includeUntrackedFiles=true, staleTime=FIVE_SECONDS, refetchOnWindowFocus=true, and background/error refetch behavior.
  • .vite/build/worker.js handles case "review-summary" by calling gitManager.getWorktreeRepository(...) and then a review summary implementation that builds temporary worktree/index snapshots.
  • The worker implementation calls Git operations such as hash-object --no-filters, add, write-tree, and diff --find-renames --numstat/name-status/raw.

In simplified form:

Codex Desktop launch
  -> Electron app-server starts
  -> renderer loads thread/list + workspace/sidebar state
  -> active workspace is restored from global state
  -> review-navigation-model mounts review metadata queries
  -> review_model sends review-summary to Git worker
  -> worker snapshots untracked-aware worktree state
  -> Git scans thousands of untracked files repeatedly
  -> Windows CPU/IO/memory spike

Why this is severe on Windows

This pattern is especially expensive on Windows because Git is being asked to read/hash/add thousands of small files from a large dirty workspace. NTFS small-file IO plus Windows Defender or other real-time scanning can amplify the cost. When the workspace has no valid HEAD/no initial commit and lots of untracked files, review-summary can remain error/stale and be repeatedly refreshed.

This makes Desktop launch feel catastrophic even though Codex CLI works normally on the same machine.

Expected behavior

Codex Desktop should not eagerly run heavyweight review-summary Git snapshot work on restored startup workspaces, especially not with untracked files included by default.

At minimum, Desktop should have guardrails such as:

  • Do not run review_model / review-summary in the background until the user actually opens a review-related surface.
  • Do not include untracked files by default for startup/sidebar metadata.
  • Detect large/no-HEAD/initial repositories and downgrade to cheap metadata only.
  • Add an untracked file count / path count / elapsed-time limit before running hash-object, add, write-tree, or full diff snapshot work.
  • Add exponential backoff when review-summary fails, instead of quick stale/error refetch loops.
  • Surface a warning instead of silently exhausting CPU/IO.

Reproduction shape

  1. On Windows, have a large workspace with many untracked files and no valid HEAD / no initial commit.
  2. Let Codex Desktop remember it as an active workspace in .codex-global-state.json.
  3. Launch Codex Desktop.
  4. Observe Desktop logs under:
%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\<date>
  1. Search for:
source=review_model
requestKind=review-summary
hash-object --no-filters
write-tree
cwd=<restored workspace>

Workaround notes

Making the affected workspace a clean, committed, tightly ignored Git repo may reduce the impact. However, this is only a workaround. Desktop should not make startup responsiveness depend on every restored workspace being a clean small Git repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingcode-reviewIssues relating to code reviews performed by codexperformancewindows-osIssues related to Codex on Windows systems

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions