codex takes ~5 seconds before entering the TUI

Resolved 💬 3 comments Opened Apr 27, 2026 by PinkD Closed Apr 27, 2026

What version of Codex CLI is running?

codex-cli 0.125.0

What subscription do you have?

not related

Which model were you using?

not related

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Alacritty

What issue are you seeing?

After upgrading codex, launching codex takes ~5 seconds before entering the TUI. Before the upgrade there's no delay.

What steps can reproduce the bug?

Upgrading codex and launching it.

What is the expected behavior?

No delay on launching codex.

Additional information

Cause

The codex found the cause by itself:

  • The delay happens before the first Codex log line is written to ~/.codex/log/codex-tui.log.
  • codex --disable plugins -c check_for_update_on_startup=false does not help
  • CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1 codex does not help
  • sample cmd shows the main thread spending most samples in macOS hostname resolution
  • DNS capture shows repeated mDNS queries for the local hostname
  • A/AAAA <local-hostname>.local. via 224.0.0.251:5353 / ff02::fb:5353

Workaround

Adding the local hostname to /etc/hosts fixes the startup delay:

127.0.0.1 <local-hostname>.local
::1       <local-hostname>.local

After flushing DNS cache and restarting mDNSResponder, codex starts normally again:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗