Skip to content

API endpoint /api/agents/:agentId/rooms returns empty list despite agent being active in rooms #4779

@standujar

Description

@standujar

Describe the bug

The API endpoint /api/agents/:agentId/rooms returns an empty list of rooms ({"success":true,"data":{"rooms":[]}}) even though the agent is actively participating in multiple rooms and responding to messages in those rooms.

To Reproduce

Start the agent with multiple connected services (Discord, Telegram, etc.)
Verify the agent is responding to messages in rooms (e.g., Discord channels)
Call the API endpoint GET /api/agents/:agentId/rooms
Observe that the response contains an empty rooms array despite the agent being active in rooms

Expected behavior

The API should return a list of all rooms where the agent is a participant. For example:

{
  "success": true,
  "data": {
    "rooms": [
      {
        "id": "room-id-1",
        "name": "Room Name 1",
        "source": "discord",
        ...
      },
      ...
    ]
  }
}

Additional context

  • In the agent logs, there are numerous successful room creations: Room [UUID] created successfully
  • Agent connection to rooms is also logged: Success: Successfully connected entity [agentId] in room [roomId]
  • When a message is received and processed in a room, the agent correctly responds
  • The logs show an error: ERROR: No room found for settings provider which might be related
  • The issue appears to be in the association between the agent and rooms in the database, or in how getRoomsForParticipant retrieves this information
  • The function that calls this API is in eliza/packages/cli/src/server/api/agent.ts, which delegates to runtime.getRoomsForParticipant(agentId) which in turn delegates to the database adapter

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions