# How to Fix Codex CLI Reconnecting and Limits Not Available Errors

Fix Codex CLI reconnecting, connection failed, and limits not available errors with daemon restart, proxy settings, and network diagnostics.

Canonical URL: https://aiidelist.com/blog/fix-codex-cli-reconnecting-error

Language: en

Published: 2026-11-28

Updated: 2026-11-28

## Key Takeaways

- `Limits: data not available yet` does not necessarily mean Codex usage limits have been exhausted.
- Codex CLI may experience connection failures even when network diagnostics pass.
- Running `codex --no-daemon` can help identify background daemon problems.
- Restarting the daemon may restore normal operation without reinstalling Codex.

## Why Does Codex CLI Keep Reconnecting?

Some developers encounter the following error when submitting a prompt in OpenAI Codex CLI:

```text
Reconnecting... waiting for network
Connection failed: error sending request
```

The `/status` command may also display:

```text
Limits: data not available yet
```

These errors can occur even when ChatGPT works normally in a browser and the internet connection appears stable.

Common causes include:

- Stale background daemon state.
- Outdated proxy environment variables.
- VPN or DNS connectivity issues.
- Interrupted WebSocket connections.
- Authentication or temporary service problems.

When network diagnostics pass but interactive execution fails, the Codex background daemon is an important component to investigate.

## Solution 1: Run Codex Without the Daemon

The quickest troubleshooting method is to launch Codex without its shared background server:

```bash
codex --no-daemon
```

For developers using a local HTTP proxy:

```bash
https_proxy=http://127.0.0.1:8080 codex --no-daemon
```

Replace `8080` with the actual HTTP proxy port.

If this command works while ordinary Codex startup fails under the same network configuration, the background daemon is likely involved in the connection problem.

This workaround does not require deleting configuration files, reinstalling Codex, or signing out of ChatGPT.

## Solution 2: Restart the Codex Background Daemon

A persistent background process may retain outdated environment variables after network or VPN changes. Opening a new terminal does not automatically update an existing process.

After completing active Codex tasks, restart the daemon:

```bash
codex app-server daemon restart
```

Then launch Codex normally:

```bash
codex
```

Submit a simple prompt and run `/status` to verify whether model execution and usage reporting work correctly.

See the [official Codex daemon documentation](https://github.com/openai/codex/blob/main/codex-rs/app-server-daemon/README.md) for additional information.

## Solution 3: Check Codex Network Connectivity

Run the built-in network diagnostic command:

```bash
codex doctor --network-only
```

This checks configuration, proxy environment variables, HTTP connectivity, and WebSocket connectivity.

However, successful diagnostics do not guarantee that an existing background daemon can complete inference requests.

| Diagnostic Result | Recommended Action |
|---|---|
| HTTP connection fails | Check VPN and proxy settings |
| WebSocket connection fails | Investigate network transport |
| Diagnostics pass but inference fails | Check actual request errors |
| Normal Codex fails but no-daemon works | Investigate the background daemon |
| Inference works but limits are missing | Check account usage reporting |

## Solution 4: Check Proxy Settings

Inspect the current terminal proxy configuration:

```bash
env | grep -i proxy
```

If the proxy runs on the same computer, using a loopback address is generally preferable to a dynamically assigned local network address.

For example:

```bash
export https_proxy=http://127.0.0.1:8080
```

Use the actual proxy port. Restart the Codex daemon after changing its required proxy environment.

## Solution 5: Test Codex in a Clean Environment

If the problem persists, test a minimal non-interactive request in a temporary directory:

```bash
codex exec --ignore-user-config --ephemeral --skip-git-repo-check -C "$(mktemp -d)" -s read-only "Reply with OK only."
```

If Codex returns `OK`, actual model inference is working in the tested environment. The remaining problem may involve user configuration, project settings, MCP integrations, or interactive session behavior.

Additional troubleshooting options include checking authentication, reviewing the [OpenAI service status](https://status.openai.com/), and checking for updates in the [Codex GitHub repository](https://github.com/openai/codex/releases).

Avoid deleting the entire Codex configuration directory as an initial troubleshooting step.

## Frequently Asked Questions

### Does Limits: Data Not Available Yet mean Codex has run out of credits?

No. It indicates that usage information is currently unavailable. It does not confirm that the usage allowance has been exhausted.

### Why does Codex Doctor pass while Codex keeps reconnecting?

Basic connectivity checks do not guarantee successful model inference. An existing daemon may also have a different network environment or unhealthy connection state.

### Is codex --no-daemon safe to use?

Yes. Supported Codex versions allow daemon-free interactive execution without deleting saved conversations. However, some shared-server features require the daemon.

### Can changing Wi-Fi or VPN settings cause Codex connection errors?

Yes. Network changes can affect proxy addresses, DNS resolution, and persistent background connections. However, the exact cause should be established through controlled troubleshooting.

## Conclusion

Codex CLI reconnecting errors and missing usage information are not always caused by exhausted credits or poor internet connectivity. The background daemon can introduce connection problems that standard network diagnostics do not detect.

**Start by testing `codex --no-daemon`.** If it works, restart the managed daemon and verify normal execution before changing DNS settings, reinstalling Codex, or replacing authentication credentials.
