Skip to content

Missing setup instructions for Sotopia API/WebSocket server on port 8080 #3

Open

Description

@jackson99tt-ctrl

Hi, thanks for releasing this project.

I am trying to run OpenAgentSafety locally, but I ran into an issue related to the Sotopia API/WebSocket server used by the NPC chat environment.

When running the evaluation, OpenHands eventually calls:

self.websocket = await self.session.ws_connect(self.websocket_url)

from:

openhands/runtime/chat/chat_npc.py

and tries to connect to:

localhost:8080

The error I get is:

aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8080

I checked evaluation/run_eval.sh and found that the script seems to expect a separate Sotopia FastAPI server to be running through tmux:

TMUX_SESSION="uv2"
TMUX_COMMAND="uv run fastapi run sotopia/api/fastapi_server.py --workers 1 --port 8080"

However, I could not find sotopia/api/fastapi_server.py in this repository, and I also did not find setup instructions explaining where this Sotopia API server should come from, how it should be installed, or which repository/branch/version should be used.

A few related issues I noticed:

  1. run_eval.sh assumes a tmux session named uv2 already exists, but the script does not create it.
  2. The main evaluation command uses Poetry, but the Sotopia server command uses uv run, so it is unclear whether the server is supposed to run inside the same project environment or a separate Sotopia workspace.
  3. sotopia and the FastAPI CLI do not appear to be clearly documented as required dependencies for starting this WebSocket server.
  4. The README mentions Sotopia conceptually, but I could not find concrete instructions for starting the API/WebSocket backend expected by chat_npc.py.

Could you please clarify the expected setup for this Sotopia API server?

Specifically:

  • Which Sotopia repository should be cloned or installed?
  • Which branch/version is compatible with OpenAgentSafety?
  • Should sotopia/api/fastapi_server.py exist inside this repository, inside a separate Sotopia checkout, or as an installed Python package?
  • Should the server be started with uv run fastapi ..., poetry run fastapi ..., or another command?
  • Should run_eval.sh create the uv2 tmux session automatically, or should users start it manually before running evaluation?

It would be very helpful to add this to the setup instructions, because without this API/WebSocket server running on port 8080, the NPC chat environment fails with a connection error.

Activity

  1. adityasoni9998 commented on Jul 6, 2026

    @adityasoni9998
    Contributor

    Hi @jackson99tt-ctrl - can you try out the codebase at https://github.com/OpenHands/benchmarks/tree/main/benchmarks/openagentsafety - it removes the sotopia dependency completely, uses a latest version of OpenHands and is much easier to work with. It is also much better maintained than this legacy research codebase.

    If you still want to use this setup, then sotopia-lab/sotopia@e51794f is the commit we used from Sotopia. The fast api server is here: https://github.com/sotopia-lab/sotopia/tree/e51794f5777c9f6433121cd92b95dece587ef8a1/sotopia/api. I think the tmux session needs to be created manually. Sotopia runs in a different python environment than the current codebase so sotopia uses uv, and this codebase uses poetry.

  2. adityasoni9998 commented on Jul 6, 2026

    @adityasoni9998
    Contributor

    Also apologies for not being clear on this - I have updated the README that links to the newer codebase.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions