From 127770d53f416023b0766b77342e1dd02b253b98 Mon Sep 17 00:00:00 2001 From: Emiel Kremers Date: Sun, 15 Mar 2026 14:17:53 +0100 Subject: [PATCH 1/3] fix(messaging): align simple messaging with thread events Use the thread direct-message event and fall back to generic event sending for connectors that do not expose specialized messaging helpers. Made-with: Cursor --- .../mods/communication/simple_messaging/adapter.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/openagents/mods/communication/simple_messaging/adapter.py b/src/openagents/mods/communication/simple_messaging/adapter.py index b81d838e2..573fca908 100644 --- a/src/openagents/mods/communication/simple_messaging/adapter.py +++ b/src/openagents/mods/communication/simple_messaging/adapter.py @@ -249,7 +249,7 @@ async def send_direct_message( # Create and send the message message = Event( - event_name="agent.direct_message.send", + event_name="thread.direct_message.send", source_id=self.agent_id, destination_id=target_agent_id, payload={ @@ -262,7 +262,10 @@ async def send_direct_message( # DO NOT add outbound messages to sender's threads - only recipients should process incoming messages # The message will be added to the recipient's thread when they receive it via process_incoming_direct_message - await self.connector.send_direct_message(message) + if hasattr(self.connector, "send_direct_message"): + await self.connector.send_direct_message(message) + else: + await self.connector.send_event(message) logger.debug(f"Sent direct message to {target_agent_id}") async def send_broadcast_message(self, content: Dict[str, Any]) -> None: @@ -287,7 +290,10 @@ async def send_broadcast_message(self, content: Dict[str, Any]) -> None: # Add message to the broadcast conversation thread message.thread_name = get_broadcast_event_thread_id() - await self.connector.send_broadcast_message(message) + if hasattr(self.connector, "send_broadcast_message"): + await self.connector.send_broadcast_message(message) + else: + await self.connector.send_event(message) logger.debug("Sent broadcast message") async def send_text_message(self, target_agent_id: str, text: str) -> None: From 60614405b24f42e80f24c9456b66bbeb87335e84 Mon Sep 17 00:00:00 2001 From: Emiel Kremers Date: Sun, 15 Mar 2026 14:50:10 +0100 Subject: [PATCH 2/3] fix(ci): install backend test dependencies in client tests Install workspace backend requirements before running workspace backend tests so FastAPI imports resolve in the client-tests job. Made-with: Cursor --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 36e30e18e..e74158fac 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -39,6 +39,7 @@ jobs: python -m pip install --upgrade pip pip install pytest pytest-asyncio pytest-aiohttp pytest-mock pip install -e . + pip install -r workspace/backend/requirements.txt - name: Test ONM primitives run: pytest --tb=short -v tests/test_onm_addressing.py tests/test_onm_events.py tests/test_onm_pipeline.py From 1f5b6b9fd34c267443d20cd1efc129388988775d Mon Sep 17 00:00:00 2001 From: Emiel Kremers Date: Mon, 16 Mar 2026 00:28:52 +0100 Subject: [PATCH 3/3] Address Copilot review feedback on PR #310 - Register thread.direct_message.* handler in SimpleMessagingNetworkMod so DMs routed via the thread namespace are still processed for history and file attachments - Replace full requirements.txt with minimal requirements-test.txt in CI to avoid installing playwright, boto3, firebase-admin etc. - Include requirements-test.txt in pip cache key Co-Authored-By: Claude Opus 4.6 --- .github/workflows/pytest.yml | 4 ++-- src/openagents/mods/communication/simple_messaging/mod.py | 5 +++++ workspace/backend/requirements-test.txt | 8 ++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 workspace/backend/requirements-test.txt diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e74158fac..7270d67a8 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -30,7 +30,7 @@ jobs: - uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-client-${{ hashFiles('**/pyproject.toml') }} + key: ${{ runner.os }}-pip-client-${{ hashFiles('**/pyproject.toml', 'workspace/backend/requirements-test.txt') }} restore-keys: | ${{ runner.os }}-pip-client- @@ -39,7 +39,7 @@ jobs: python -m pip install --upgrade pip pip install pytest pytest-asyncio pytest-aiohttp pytest-mock pip install -e . - pip install -r workspace/backend/requirements.txt + pip install -r workspace/backend/requirements-test.txt - name: Test ONM primitives run: pytest --tb=short -v tests/test_onm_addressing.py tests/test_onm_events.py tests/test_onm_pipeline.py diff --git a/src/openagents/mods/communication/simple_messaging/mod.py b/src/openagents/mods/communication/simple_messaging/mod.py index 17bad2c3f..5c687933c 100644 --- a/src/openagents/mods/communication/simple_messaging/mod.py +++ b/src/openagents/mods/communication/simple_messaging/mod.py @@ -37,6 +37,11 @@ def __init__(self, mod_name: str = "simple_messaging"): self.register_event_handler( self._handle_direct_message, "agent.direct_message.*" ) + # Also handle thread-namespaced DM events (used by adapters that + # target the workspace/thread messaging mod pipeline). + self.register_event_handler( + self._handle_direct_message, "thread.direct_message.*" + ) self.register_event_handler( self._handle_broadcast_message, "agent.broadcast_message.*" ) diff --git a/workspace/backend/requirements-test.txt b/workspace/backend/requirements-test.txt new file mode 100644 index 000000000..807f355aa --- /dev/null +++ b/workspace/backend/requirements-test.txt @@ -0,0 +1,8 @@ +# Minimal deps for running workspace backend tests in CI +fastapi>=0.115.0 +uvicorn>=0.30.0 +pydantic>=2.0.0 +sqlalchemy>=2.0.0 +python-dotenv>=1.0.0 +python-multipart>=0.0.9 +httpx>=0.25.0