App hangs and returns to sign-in screen every ~40–60 s — excessive disk writes (2.1 GB / 12 min) throttled by macOS

Open 💬 1 comment Opened Aug 26, 2026 by nat289
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

26.820.60940 (7119)

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.6.0 arm64 arm , macOS 26.6.2 (build 25G83) — MacBook Air, Mac14,15, 8 GB RAM

What issue are you seeing?

After a successful login, the app returns to the "Sign in to ChatGPT" screen roughly 40–60 seconds later, in a continuous loop. The app is unusable.

This is not an authentication failure. Tokens refresh correctly and remain valid (auth_mode: chatgpt, access_token valid for a further 10 days, last_refresh updated minutes before each failure). No 401 or 403 appears anywhere in the system log during the failure window, and the same account stays signed in indefinitely at chatgpt.com in a browser.

The actual cause appears to be a hang caused by excessive disk writes. A macOS spindump report:

Command: ChatGPT
Identifier: com.openai.codex
Version: 26.820.60940 (7119)

Event: disk writes
Action taken: none
Writes: 2147.72 MB of file backed memory dirtied over 717 seconds
(2994.89 KB per second average), exceeding limit of
24.86 KB per second over 86400 seconds
Writes limit: 2147.48 MB
Writes duration: 717s

Heaviest stack for the target process:
3 thread_start + 8 (libsystem_pthread.dylib + 7196)
3 _pthread_start + 136 (libsystem_pthread.dylib + 27736)
3 uv_cancel + 944 (Codex Framework + 76939016)
3 write + 8 (libsystem_kernel.dylib + 18484)

The heaviest stack is blocked in write() via uv_cancel inside Codex Framework. macOS throttles the process, the app hangs, and the UI falls back to the login screen.

A likely contributor: ~/.codex/logs_2.sqlite had grown to 778 MB and was being rewritten continuously.

Correlated system log at the moment of failure:

10:45:47 ChatGPT app starts
10:46:15 spindump (CrashReporterSupport) Saved diag report for ChatGPT
version 26.820.60940
10:46:29 ChatGPT [com.apple.Safari:AuthenticationSession]
Connection to server invalidated.
10:46:29 ChatGPT [com.apple.xpc:connection]
Re-initialization successful; calling out to event handler
with XPC_ERROR_CONNECTION_INTERRUPTED

The ASWebAuthenticationSession is invalidated ~42 s after launch, immediately after the spindump fires — consistent with a hang rather than a credential rejection.

What steps can reproduce the bug?

Launch the app.
Sign in with ChatGPT — login completes successfully.
Use the app normally, or simply leave it open.
After ~40–60 seconds, the app returns to the "Sign in to ChatGPT" screen.
The cycle repeats indefinitely.

Reproduces 100% of the time, including from a completely fresh profile.

Ruled out through testing — all ineffective:

Full app reinstall (removed from /Applications, Trash emptied, fresh download)
Cleared Cookies, Cookies-journal, Session Storage, Local Storage, WebStorage in ~/Library/Application Support/Codex/Default/
Switched credential storage to the macOS default (cli_auth_credentials_store = "keyring"), removed the plaintext auth.json, purged stale keychain entries, signed in fresh
Removed a third-party local proxy and the openai_base_url = "http://127.0.0.1:10100/v1" line it had injected into ~/.codex/config.toml; confirmed the service stopped and the port free
Quit third-party menu-bar helpers
Deleted the 778 MB logs_2.sqlite
Verified the system clock (automatic, accurate)
Cross-checked the same account in a browser — stays signed in indefinitely
Started from a completely fresh profile (~/.codex moved aside) — the loop still reproduces, ruling out any user configuration, plugin, session history or credential state

What is the expected behavior?

The session should persist after a successful login. The app should not hang, and should not fall back to the sign-in screen when the underlying failure is a local hang rather than an authentication problem.

Additional information

This may be the same underlying defect as #39803 (identical symptom on build 26.818.22352, still open) and #19264. Neither has a fix; the only workaround mentioned is running an earlier build.

Two changes would make this class of failure far easier to diagnose:

Surface a distinguishable error state when the session is lost due to a hang or local failure, instead of falling back to the generic sign-in screen. Because the app silently returns to the login screen, every visible signal points at authentication — which sent this investigation through tokens, cookies, keychain, proxy config and a full reinstall before a macOS spindump revealed the real cause.
Cap or rotate logs_2.sqlite. A 778 MB log database being continuously rewritten is a defect in its own right and is the likely trigger for the write throttling.

This cost a full working day of debugging, and the app remains unusable. A download link for an earlier build would be very welcome in the meantime.

The full spindump report and system logs are available on request.

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 2 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #39875

Powered by Codex Action