Codex App has ~5s lag when opening a new durable thread in a git repo
What version of the Codex App are you using (From "About Codex" dialog)?
26.601.21317
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.19044.0 x64
What issue are you seeing?
Opening a new thread in the Codex App causes an obvious stall of about 5-6 seconds when the working directory is inside a git repository.
This appears to be a backend thread-start regression in the durable thread path, not just a UI rendering issue.
What steps can reproduce the bug?
- Open the Codex App in a git repository.
- Start a new thread.
- Observe an approximately 5 second stall before the thread is ready.
Measured against the installed app-server over JSON-RPC:
thread/startinH:\openai\codex: about5.3sthread/startwithephemeral: true: about14msthread/startin a non-git temp directory: about180msthread/startin a tiny fresh git repo: about5.9s
This isolates the regression to the non-ephemeral thread-persistence path when cwd is in a git repo.
What is the expected behavior?
Starting a new thread should be near-instant, or at least should not synchronously block for about 5 seconds on repo metadata collection during thread startup.
Additional information
Primary code path:
- codex-rs/thread-store/src/live_thread.rs calls
ThreadMetadataSync::for_create(...)beforethread/startreturns. - codex-rs/thread-store/src/thread_metadata_sync.rs eagerly collects git metadata during
for_create(...). - codex-rs/git-utils/src/info.rs defines
GIT_COMMAND_TIMEOUTas 5 seconds. - codex-rs/git-utils/src/info.rs
collect_git_info(...)runs: git rev-parse --git-dirgit rev-parse HEADgit rev-parse --abbrev-ref HEADgit remote get-url origin
Those subprocesses are launched in parallel and awaited together. If any one hangs until timeout, thread startup inherits almost exactly the 5 second pause.
git blame points the eager collect_git_info(cwd.as_path()).await call to commit c51c65ad09 (Unify thread metadata updates above store, 2026-05-12).
Likely fix directions:
- Move git metadata collection off the
thread/startcritical path. - Create the durable thread immediately and backfill git info asynchronously via metadata update.
- If some git metadata must remain synchronous, skip or heavily shorten the startup-time timeout budget, especially for
remote get-url origin.
Notes from investigation:
- Disabling app instructions, skill instructions, plugins, bundled skills, MCP servers, and shell snapshotting did not materially change the delay.
- The lag reproduced with an empty temporary
CODEX_HOME, so this does not depend on large local history or unusual user config.
3 Comments
I have put together a branch to fix this issue for my own use, I can confirm the issue is fixed in this branch, there is still a delay measured at around a few hundred milliseconds but much better than several seconds with the current release version.
I hope this helps with investigation/reduces implementation bandwidth.
Ping @wiltzius-openai - you made the commit that I traced this issue too, could you take a look? There are dozens of issues created reporting the same thing. Personally I have fixed it in my own builds but others deserve the fix too as it represents a major UX degradation.
Closing as lag seems fixed in
26.820.60940