Severe chat-switch lag in Codex Electron from oversized git-origins root enumeration and slow thread/resume loads

Resolved 💬 1 comment Opened Mar 12, 2026 by PiquoInterest Closed Mar 12, 2026

What version of the Codex App are you using (From “About Codex” dialog)?

26.306.996.0

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

The Codex Electron app becomes very laggy and visibly freezes when switching between chats in a large dirty repo.

We confirmed two separate problems:

  1. The renderer sends oversized vscode://codex/git-origins requests that include historical project roots, not just

the active workspace roots. That fans out into cross-root Git/worktree scans.

  1. Even after locally hotfixing that path, switching chats still freezes because thread/resume / thread state load

remains slow on click.

This is happening in the production Electron app. The repo state is the trigger, not the root cause.

Relevant observed log lines included:

  • method=thread/resume ... durationMs=1650
  • method=thread/resume ... durationMs=991
  • method=thread/resume ... durationMs=958
  • method=thread/resume ... durationMs=979
  • method=mcpServerStatus/list ... durationMs=6037
  • method=mcpServerStatus/list ... durationMs=8395
  • method=mcpServerStatus/list ... durationMs=7775

Before the hotfix, Git-related warnings on switch/startup also included repeated aborted metadata calls like:

  • subcommand=for-each-ref
  • subcommand=remote
  • subcommand=rev-parse
  • subcommand=symbolic-ref

The practical symptom is simple: clicking a different chat can freeze the UI for a noticeable amount of time.

What steps can reproduce the bug?

  1. Open the production Codex Electron app on Windows.
  2. Use it against a large dirty repo with a very large pending diff.
  3. Have historical project/worktree roots present in app state from prior usage.
  4. Open the sidebar thread list.
  5. Switch between existing chats in that repo.
  6. Observe multi-second lag or visible freezing on chat switch.

Observed triggering conditions in the affected environment:

  • very large dirty repo state
  • historical roots remembered by the app, including stale worktree paths
  • thread switching between existing chats

This is not a context-window issue and does not require a large prompt. The lag is reproducible by opening the app and switching chats

What is the expected behavior?

Switching between chats should be consistently responsive, even in a large dirty repo.

Expected behavior:

  • vscode://codex/git-origins should include only current active workspace roots
  • historical or stale roots should not be reintroduced into Git/worktree resolution
  • no cross-root git worktree list --porcelain storm should occur during startup or chat switch
  • chat switching should not visibly block on thread/resume
  • slow background status polling should not degrade thread-switch interactions

Additional information

We applied a local live-session hotfix and confirmed that the root cause is real.

Local hotfix/workaround:

  • short-circuited slow renderer bridge calls for:
  • skills/list
  • app/list
  • config/read
  • filtered vscode://codex/git-origins request bodies down to current plain roots only
  • normalized vscode://codex/local-environments workspace-root paths

Result:

  • the oversized historical-root git-origins request was reduced to only current roots
  • cross-root Git/worktree fanout stopped
  • the Git/worktree bug was locally mitigated
  • chat switching still froze due to the remaining thread/resume / thread state load path

Expected product-side fixes:

  1. Build git-origins only from active current workspace roots for the current session.
  2. Prune or memoize missing/stale roots after failure instead of re-resolving them repeatedly.
  3. Do not block visible chat switching on thread/resume / thread state load.
  4. Ensure expensive background status calls such as mcpServerStatus/list do not gate or degrade thread-switch

interactions.

  1. Cache or prewarm recently visible threads so first-click thread switches do not freeze the UI.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗