Skip to content

[BUG] openai_client.py example fails with 400 Bad Request #6

@hutho

Description

@hutho

Hello,

I am having trouble running the openai_client.py example on a fresh installation. I have followed the Quick
Start guide, and the coderunner container appears to be running correctly. I can access the MCP server via its
IP address in a browser (which returns the expected "Not Acceptable" error), but the Python client fails.

Steps to Reproduce:

  1. Cloned the repository.
  2. Ran sudo ./install.sh successfully.
  3. Created a venv and ran pip install -r examples/requirements.txt.
  4. Confirmed the coderunner container is running via container list.
  5. Added 192.168.64.2 coderunner.local to my /etc/hosts file.
  6. Exported my OPENAI_API_KEY.
  7. Ran the client using the venv's python: ./coderunner/venv/bin/python3
    coderunner/examples/openai_agents/openai_client.py

Expected Behavior:

The script should start and prompt for input.

Actual Behavior:

The script fails immediately with a 400 Bad Request error.

Terminal Output:

1 > httpx.HTTPStatusError: Client error '400 Bad Request' for url 'http://192.168.64.2:8222/mcp'
2 > 3 > 4 > **`container logs coderunner` shows:** 5 > 6 > 1 > WARNING: Invalid HTTP request received. 2 >
3 >
4 > System Details:
5 >
6 > * macOS (Apple Silicon)
7 > * Python 3.13
8 >
9 > It seems there might be an incompatibility between the openai-agents client example and the
current version of the coderunner server. Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions