Skip to content

Connection failed: error sending request #42936

Closed

Description

@kamilkowdev

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

Powered by Codex & OWL Wersja 26.901.31953

What subscription do you have?

Plus

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

After sending message to codex it returns " Reconnecting... waiting for network
Connection failed: error sending request"

What steps can reproduce the bug?

Open new chat
Send message
receive - Reconnecting... waiting for network
Connection failed: error sending request

What is the expected behavior?

Message is send and codex returning message

Additional information

Image

Activity

  1. added
    app
    on Sep 5, 2026
  2. added
    bug
    connectivity
    on Sep 5, 2026
  3. kamilkowdev commented on Sep 5, 2026

    @kamilkowdev
    Author
    Image

    ^ Same thing for codex in VS Code terminal

  4. kamilkowdev commented on Sep 5, 2026

    @kamilkowdev
    Author

    Cause of the problem

    The Codex logs (~/.codex/logs_2.sqlite) show the exact cause of the error:

    Request failed method=POST url=http://127.0.0.1:8787/chatgpt/responses error=error sending request for url (http://127.0.0.1:8787/chatgpt/responses)
    
    stream connection failed; waiting to retry turn_id=... error=Connection failed: error sending request retry_delay=20s
    
    1. Traffic was redirected through Caveman:
      The Caveman tool, installed at:

      /XXX/YYY/ai-stack/npm-global/bin/caveman
      

      changed the Codex configuration in ~/.codex/config.toml and set Caveman as the model provider:

      # >>> caveman:native-root
      
      model_provider = "caveman"
      
      # <<< caveman:native-root
      
      [model_providers.caveman]
      base_url = "http://127.0.0.1:8787/chatgpt"
    2. The Caveman daemon was not running on port 8787.

      Because of this, every time Codex tried to send a message, it connected to:

      http://127.0.0.1:8787
      

      instead of connecting directly to the OpenAI servers.

      This caused the following errors:

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

    Solution

    I found the solution after creating a ticket about this issue on the Codex GitHub repository.

    The problem was not caused by Codex itself or by the network connection. It was caused by the local Caveman configuration redirecting Codex traffic to 127.0.0.1:8787.

    After removing or disabling the Caveman model provider from ~/.codex/config.toml and restoring the normal OpenAI configuration, Codex started working correctly again.

    So in my case, the fix was to remove the Caveman redirect from the Codex configuration or make sure the Caveman daemon is running before starting Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugconnectivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions