codex - 💡(How to fix) Fix CLI startup has a fixed ~15s `session_init.auth_mcp` delay with custom localhost provider and API-key auth when `requires_openai_auth = true` [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17531Fetched 2026-04-12 13:26:55
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Root Cause

Interactive Codex startup in the terminal is consistently slow because startup spends a fixed ~15 seconds in:

Code Example

session_init.auth_mcp ... time.idle=15.0s

---

model_provider = "custom"
model = "gpt-5.4"

[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "http://localhost:8317/v1"

---

codex login status
Logged in using an API key

---

real    0m21.630s
  user    0m2.548s
  sys     0m0.720s

---

2026-04-12T10:45:56.162921Z  INFO ... session_init.auth_mcp ... new
2026-04-12T10:46:11.179440Z  INFO ... session_init.auth_mcp ... close time.busy=13.7ms time.idle=15.0s
2026-04-12T10:46:11.237362Z  INFO ... session_init: codex_core::codex: close time.busy=42.9ms time.idle=15.0s

---

starting remote plugin sync
chatgpt authentication required to sync remote plugins; api key auth is not supported
failed to warm featured plugin ids cache ... 401 Unauthorized

---

model_provider = "custom"
model = "gpt-5.4"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "http://localhost:8317/v1"

---

codex login --with-api-key

---

time codex

---

session_init.auth_mcp ... time.idle=15.0s
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.120.0

What subscription do you have?

OpenAI API

Which model were you using?

gpt-5.4

What platform is your computer?

Windows 11 host + WSL2 Ubuntu 24.04.4 LTS (Linux 6.6.87.2-microsoft-standard-WSL2 x86_64)

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

bash inside WSL2

What issue are you seeing?

Interactive Codex startup in the terminal is consistently slow because startup spends a fixed ~15 seconds in:

session_init.auth_mcp ... time.idle=15.0s

The current setup uses a custom localhost model provider with:

model_provider = "custom"
model = "gpt-5.4"

[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "http://localhost:8317/v1"

Auth mode is API key login:

codex login status
Logged in using an API key

Observed behavior:

  • codex --help is fast
  • interactive codex startup is slow
  • recent real startup timing was:
    real    0m21.630s
    user    0m2.548s
    sys     0m0.720s
  • the dominant fixed delay in the log is still session_init.auth_mcp ... time.idle=15.0s

Relevant recent log excerpt:

2026-04-12T10:45:56.162921Z  INFO ... session_init.auth_mcp ... new
2026-04-12T10:46:11.179440Z  INFO ... session_init.auth_mcp ... close time.busy=13.7ms time.idle=15.0s
2026-04-12T10:46:11.237362Z  INFO ... session_init: codex_core::codex: close time.busy=42.9ms time.idle=15.0s

There are also plugin-sync warnings during startup:

starting remote plugin sync
chatgpt authentication required to sync remote plugins; api key auth is not supported
failed to warm featured plugin ids cache ... 401 Unauthorized

However, those requests fail quickly and do not appear to explain the fixed 15s delay.

I also ruled out a few nearby hypotheses locally:

  • deleting the VS Code Codex extension did not remove the 15s auth_mcp delay
  • changing requires_openai_auth = false as a temporary test did not eliminate the same 15s auth_mcp delay in my local runs
  • previous database is locked symptoms appear to have been a side issue, not the current dominant startup blocker

This looks related to the general auth_mcp startup-latency class of bugs, but this reproduction is specifically about:

  • custom localhost provider
  • requires_openai_auth = true
  • API-key login mode
  • fixed ~15s terminal startup delay on WSL2

What steps can reproduce the bug?

  1. Configure a custom localhost model provider in ~/.codex/config.toml:
model_provider = "custom"
model = "gpt-5.4"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "http://localhost:8317/v1"
  1. Log in with API key mode:
codex login --with-api-key
  1. Start Codex interactively from WSL2:
time codex
  1. Inspect ~/.codex/log/codex-tui.log

  2. Observe that startup contains:

session_init.auth_mcp ... time.idle=15.0s

What is the expected behavior?

Interactive startup should not incur a fixed ~15s delay in session_init.auth_mcp.

If this auth path is required, it should either:

  • complete quickly for API-key login mode, or
  • be skipped when it is not needed for the active provider/auth combination.

Additional information

A few more details that may help narrow scope:

  • This is in WSL2, but the current fixed 15s delay persists even after removing the VS Code extension, so it does not look like an extension-sharing issue anymore.
  • The plugin-sync warnings suggest a mismatch between ChatGPT-only remote plugin sync and API-key login mode, but those warnings return quickly and seem secondary.
  • This may be distinct from the already-fixed disabled-MCP probing bug, because the 15s delay here still occurs in an active custom-provider setup and shows up before session_init.mcp_manager_init in the logs.

extent analysis

TL;DR

The 15-second delay in Codex startup is likely due to the auth_mcp process waiting for a timeout, and a potential workaround is to investigate and adjust the authentication mechanism or the custom localhost model provider configuration.

Guidance

  • Investigate the auth_mcp process and its dependencies to understand why it's waiting for 15 seconds, considering the custom localhost provider and API-key login mode.
  • Verify if the requires_openai_auth = true setting is necessary for the custom provider and if it can be adjusted or removed to bypass the delay.
  • Check the plugin-sync warnings and their potential impact on the startup process, although they seem to return quickly and may be secondary to the main issue.
  • Review the Codex configuration and logs to ensure there are no other contributing factors, such as database locks or extension-related issues, which have already been ruled out in this case.

Example

No specific code snippet is provided, as the issue seems to be related to the configuration and authentication mechanism rather than a specific code block.

Notes

The exact cause of the 15-second delay is unclear, and further investigation is needed to determine the root cause. The provided information suggests that the issue is related to the auth_mcp process and the custom localhost model provider configuration.

Recommendation

Apply a workaround by investigating and adjusting the authentication mechanism or the custom localhost model provider configuration, as the root cause of the issue is not immediately clear and may require further debugging.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING