Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-

Expand All @@ -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-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
Expand Down
12 changes: 9 additions & 3 deletions src/openagents/mods/communication/simple_messaging/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — the SimpleMessagingNetworkMod now also registers a handler for thread.direct_message.* events, so both the old agent.direct_message.* and new thread.* event names are processed. This ensures simple_messaging features (history, file attachments) work regardless of which event namespace the adapter uses.

source_id=self.agent_id,
destination_id=target_agent_id,
payload={
Expand All @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions src/openagents/mods/communication/simple_messaging/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
)
Expand Down
8 changes: 8 additions & 0 deletions workspace/backend/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -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
Loading