Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

Let main's room detail stubs take the caller's permissions

Abel Dantas6fa1578978cd
diff --git a/core/tests/switch_core/gateway/test_chats_groups.py b/core/tests/switch_core/gateway/test_chats_groups.py
index 79f3c46ce..8aee6c204 100644
--- a/core/tests/switch_core/gateway/test_chats_groups.py
+++ b/core/tests/switch_core/gateway/test_chats_groups.py
@@ -1389,7 +1389,9 @@ async def test_renaming_an_agent_in_many_rooms_reads_them_in_one_query(
async def test_only_a_manager_renames_a_group_and_everyone_sees_it(
chats: _Harness, monkeypatch: pytest.MonkeyPatch
) -> None:
- async def detail(_session: AsyncSession, room: Room, *_args: Any) -> str:
+ async def detail(
+ _session: AsyncSession, room: Room, *_args: Any, **_kwargs: Any
+ ) -> str:
return room.name
monkeypatch.setattr(rooms_module, "_build_room_detail", detail)
diff --git a/core/tests/switch_core/gateway/test_room_participant_read.py b/core/tests/switch_core/gateway/test_room_participant_read.py
index 5bf269f68..0d3a14cce 100644
--- a/core/tests/switch_core/gateway/test_room_participant_read.py
+++ b/core/tests/switch_core/gateway/test_room_participant_read.py
@@ -88,7 +88,9 @@ async def _write(session: AsyncSession, room_id: str, user: User) -> None:
async def test_participants_read_a_private_room_and_change_nothing(
session_factory: async_sessionmaker[AsyncSession], monkeypatch: pytest.MonkeyPatch
) -> None:
- async def detail(_session: AsyncSession, room: Room, *_args: Any) -> str:
+ async def detail(
+ _session: AsyncSession, room: Room, *_args: Any, **_kwargs: Any
+ ) -> str:
return room.id
monkeypatch.setattr(rooms_module, "_build_room_detail", detail)
diff --git a/core/tests/switch_core/gateway/test_room_sync_name.py b/core/tests/switch_core/gateway/test_room_sync_name.py
index 86a13d000..84062b866 100644
--- a/core/tests/switch_core/gateway/test_room_sync_name.py
+++ b/core/tests/switch_core/gateway/test_room_sync_name.py
@@ -35,7 +35,9 @@ async def _sync(chats: _Harness, room_id: str, user: User) -> str:
async def test_the_owner_takes_the_channel_name_and_others_may_not(
chats: _Harness, monkeypatch: pytest.MonkeyPatch
) -> None:
- async def detail(_session: AsyncSession, room: Room, *_args: Any) -> str:
+ async def detail(
+ _session: AsyncSession, room: Room, *_args: Any, **_kwargs: Any
+ ) -> str:
return room.name
monkeypatch.setattr(rooms_module, "_build_room_detail", detail)