| Error | A JavaScript error occurred in the main process / Uncaught Exception: Error: Connection for host ID local not found |
|---|---|
| Stack | getConnection → createAppHost → IpcMainImpl |
| Tool | ChatGPT (Codex) desktop app, Microsoft Store package OpenAI.Codex 26.1117 to 26.1123; also seen on macOS and Linux |
| When | Reopening the app a few seconds after quitting, or right after an update hands over to the new version |
| Workaround | Click OK and launch again, or wait for the old processes to exit before reopening |
| Status | Reported by users, not official. Still reproduced on 26.1123.12889.0 (2 Dec) and 26.1123.13983.0 (3 Dec) |
| Checked | 4 Dec 2026, against the sources listed below |
Fix it
- Click OK and launch the app again. Users report the second launch works, because by then the old processes have finished exiting.
- Next time, wait before reopening. After you quit, the app's helper processes keep running for a few seconds. Reopen only after they're gone. In one report, the gap was about five seconds.
- If it fails on every cold start, even after a reboot, check the right-hand panel of your chats. One user had a file tab there that kept flashing (failing to load). Closing that tab, quitting fully, and waiting for all processes to exit stopped the error on cold start.
- If the app still won't open, add your app version and the time it happened to issue #62722 on github.com/openai/codex.
Why it happens
Users who read the desktop logs found the same order of events each time. The old instance disconnects its local app-server, then about 2.4 seconds later it still opens a new main window. That window asks for the local connection, which is already gone, so getConnection throws. It's a timing problem between shutdown and relaunch, not a problem with your files or your account. OpenAI hasn't commented on the issue.
How to check
Right after you quit, open Task Manager. If ChatGPT or Codex processes are still listed, wait until they disappear, then open the app. In PowerShell:
Get-Process | Where-Object { $_.Path -like "*WindowsApps\OpenAI.Codex*" }
When this prints nothing, the old instance has exited. One user saw codex-windows-sandbox-service.exe stay running; it didn't block a normal launch.
What didn't help in reports
- Reinstalling, or clearing the local app and
.codexstate (it came back on a clean install). - Disabling the Chrome extension integration.
- Adding
respect_system_proxy = truetoconfig.toml. - Windows Settings > Apps > Repair, and restarting Windows.
Running Claude Code, Codex or Cursor on real repos, or shipping an AI agent? A Quick Review ($149 / ₹13,900, 1 working day) checks one repo, config or setup for leaked keys, risky agent permissions and MCP servers. Request a Quick Review
FAQ
How do I fix 'Connection for host ID local not found'?
Click OK and open the app again. To avoid it, wait a few seconds after quitting, until the app's background processes have exited, before reopening. This is a workaround reported by users, not an official fix.
Is my data lost?
No report in the main issue (#62722) mentions lost chats. The next launch opens normally.
Why does it happen on every second launch?
The failed launch gives the old processes time to finish exiting, so the launch after it works. Users saw this alternating pattern on Windows.
Has OpenAI fixed it?
Not as of 4 Dec 2026. Users still reproduced it on Microsoft Store packages 26.1123.12889.0 and 26.1123.13983.0.
Related errors
- Codex not working on Windows
- ChatGPT Work: permission selector missing in new chats
- Codex: elastic section minimums must sum to 128000
Sources
Read 4 Dec 2026. These tools change often: if a step no longer matches, the linked page wins.
- openai/codex #62722 (main issue, 35 comments): github.com/openai/codex/issues/62722
- openai/codex #62722: wait for processes to exit (Task Manager test): github.com/openai/codex/issues/62722#issuecomment-7054637686
- openai/codex #62722: log timing and suspected race: github.com/openai/codex/issues/62722#issuecomment-7155132883
- openai/codex #62722: cold-start trigger from a stuck file tab: github.com/openai/codex/issues/62722#issuecomment-7278891511
- openai/codex #62918 (same relaunch error with Work send problems): github.com/openai/codex/issues/62918
- openai/codex #64186: github.com/openai/codex/issues/64186
- reviewready CLI: one command that checks an AI app repo before it ships
- Exposed API key checker: find API keys committed to a repo or shipped to the browser
- MCP config checker: scan your mcp.json for hard-coded tokens, unpinned servers and risky access