Severe chat-switch lag in Codex Electron from oversized git-origins root enumeration and slow thread/resume loads
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:
- The renderer sends oversized
vscode://codex/git-originsrequests that include historical project roots, not just
the active workspace roots. That fans out into cross-root Git/worktree scans.
- 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=1650method=thread/resume ... durationMs=991method=thread/resume ... durationMs=958method=thread/resume ... durationMs=979method=mcpServerStatus/list ... durationMs=6037method=mcpServerStatus/list ... durationMs=8395method=mcpServerStatus/list ... durationMs=7775
Before the hotfix, Git-related warnings on switch/startup also included repeated aborted metadata calls like:
subcommand=for-each-refsubcommand=remotesubcommand=rev-parsesubcommand=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?
- Open the production Codex Electron app on Windows.
- Use it against a large dirty repo with a very large pending diff.
- Have historical project/worktree roots present in app state from prior usage.
- Open the sidebar thread list.
- Switch between existing chats in that repo.
- 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-originsshould include only current active workspace roots- historical or stale roots should not be reintroduced into Git/worktree resolution
- no cross-root
git worktree list --porcelainstorm 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/listapp/listconfig/read- filtered
vscode://codex/git-originsrequest bodies down to current plain roots only - normalized
vscode://codex/local-environmentsworkspace-root paths
Result:
- the oversized historical-root
git-originsrequest 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:
- Build
git-originsonly from active current workspace roots for the current session. - Prune or memoize missing/stale roots after failure instead of re-resolving them repeatedly.
- Do not block visible chat switching on
thread/resume/ thread state load. - Ensure expensive background status calls such as
mcpServerStatus/listdo not gate or degrade thread-switch
interactions.
- Cache or prewarm recently visible threads so first-click thread switches do not freeze the UI.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗