Skip to content
Merged
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: 3 additions & 0 deletions dimos/agents/memory/test_image_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
class TestImageEmbedding:
"""Test class for CLIP image embedding functionality."""

@pytest.mark.tofix
def test_clip_embedding_initialization(self):
"""Test CLIP embedding provider initializes correctly."""
try:
Expand All @@ -44,6 +45,7 @@ def test_clip_embedding_initialization(self):
except Exception as e:
pytest.skip(f"Skipping test due to model initialization error: {e}")

@pytest.mark.tofix
def test_clip_embedding_process_video(self):
"""Test CLIP embedding provider can process video frames and return embeddings."""
try:
Expand Down Expand Up @@ -148,6 +150,7 @@ def on_completed():
except Exception as e:
pytest.fail(f"Test failed with error: {e}")

@pytest.mark.tofix
def test_clip_embedding_similarity(self):
"""Test CLIP embedding similarity search and text-to-image queries."""
try:
Expand Down
34 changes: 16 additions & 18 deletions dimos/agents/test_agent_image_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@

"""Test BaseAgent with AgentMessage containing images."""

import logging
import os

import numpy as np
from dotenv import load_dotenv
import pytest
from dotenv import load_dotenv

from dimos.agents.modules.base import BaseAgent
from dimos.agents.agent_message import AgentMessage
from dimos.agents.modules.base import BaseAgent
from dimos.msgs.sensor_msgs import Image
from dimos.msgs.sensor_msgs.Image import ImageFormat
from dimos.utils.logging_config import setup_logger
import logging

logger = setup_logger("test_agent_image_message")
# Enable debug logging for base module
logging.getLogger("dimos.agents.modules.base").setLevel(logging.DEBUG)


@pytest.mark.tofix
def test_agent_single_image():
"""Test agent with single image in AgentMessage."""
load_dotenv()
Expand Down Expand Up @@ -92,6 +94,7 @@ def test_agent_single_image():
agent.dispose()


@pytest.mark.tofix
def test_agent_multiple_images():
"""Test agent with multiple images in AgentMessage."""
load_dotenv()
Expand Down Expand Up @@ -159,6 +162,7 @@ def test_agent_multiple_images():
agent.dispose()


@pytest.mark.tofix
def test_agent_image_with_context():
"""Test agent maintaining context with image queries."""
load_dotenv()
Expand Down Expand Up @@ -207,6 +211,7 @@ def test_agent_image_with_context():
agent.dispose()


@pytest.mark.tofix
def test_agent_mixed_content():
"""Test agent with mixed text-only and image queries."""
load_dotenv()
Expand All @@ -232,10 +237,11 @@ def test_agent_mixed_content():
msg2.add_text("What do you see? Describe the scene.")

# Use first frame from rgbd_frames test data
from dimos.utils.data import get_data
from dimos.msgs.sensor_msgs import Image
from PIL import Image as PILImage
import numpy as np
from PIL import Image as PILImage

from dimos.msgs.sensor_msgs import Image
from dimos.utils.data import get_data

data_path = get_data("rgbd_frames")
image_path = os.path.join(data_path, "color", "00000.png")
Expand Down Expand Up @@ -283,6 +289,7 @@ def test_agent_mixed_content():
agent.dispose()


@pytest.mark.tofix
def test_agent_empty_image_message():
"""Test edge case with empty parts of AgentMessage."""
load_dotenv()
Expand Down Expand Up @@ -330,6 +337,7 @@ def test_agent_empty_image_message():
agent.dispose()


@pytest.mark.tofix
def test_agent_non_vision_model_with_images():
"""Test that non-vision models handle image input gracefully."""
load_dotenv()
Expand Down Expand Up @@ -366,12 +374,13 @@ def test_agent_non_vision_model_with_images():
agent.dispose()


@pytest.mark.tofix
def test_mock_agent_with_images():
"""Test mock agent with images for CI."""
# This test doesn't need API keys

from dimos.agents.test_base_agent_text import MockAgent
from dimos.agents.agent_types import AgentResponse
from dimos.agents.test_base_agent_text import MockAgent

# Create mock agent
agent = MockAgent(model="mock::vision", system_prompt="Mock vision agent")
Expand All @@ -393,14 +402,3 @@ def test_mock_agent_with_images():

# Clean up
agent.dispose()


if __name__ == "__main__":
test_agent_single_image()
test_agent_multiple_images()
test_agent_image_with_context()
test_agent_mixed_content()
test_agent_empty_image_message()
test_agent_non_vision_model_with_images()
test_mock_agent_with_images()
print("\n✅ All image message tests passed!")
3 changes: 3 additions & 0 deletions dimos/agents/test_agent_message_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def get_responses(self):
return self.responses


@pytest.mark.tofix
@pytest.mark.module
@pytest.mark.asyncio
async def test_agent_message_video_stream():
Expand Down Expand Up @@ -250,6 +251,7 @@ async def test_agent_message_video_stream():
dimos.shutdown()


@pytest.mark.tofix
@pytest.mark.module
@pytest.mark.asyncio
async def test_agent_message_multi_image():
Expand Down Expand Up @@ -327,6 +329,7 @@ async def test_agent_message_multi_image():
dimos.shutdown()


@pytest.mark.tofix
def test_agent_message_text_only():
"""Test BaseAgent with text-only AgentMessage."""
load_dotenv()
Expand Down
3 changes: 3 additions & 0 deletions dimos/agents/test_agent_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def get_responses(self):
return self.responses


@pytest.mark.tofix
@pytest.mark.module
@pytest.mark.asyncio
async def test_agent_module_with_tools():
Expand Down Expand Up @@ -238,6 +239,7 @@ async def test_agent_module_with_tools():
dimos.shutdown()


@pytest.mark.tofix
def test_base_agent_direct_tools():
"""Test BaseAgent direct usage with tools."""
load_dotenv()
Expand Down Expand Up @@ -364,6 +366,7 @@ def dispose(self):
pass


@pytest.mark.tofix
def test_mock_agent_tools():
"""Test mock agent with tools for CI."""
# Create skill library
Expand Down
1 change: 1 addition & 0 deletions dimos/agents/test_agent_with_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def get_responses(self):
return self.responses


@pytest.mark.tofix
@pytest.mark.module
@pytest.mark.asyncio
async def test_agent_module_connections():
Expand Down
8 changes: 8 additions & 0 deletions dimos/agents/test_base_agent_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def get_responses(self):
return self.responses


@pytest.mark.tofix
def test_base_agent_direct_text():
"""Test BaseAgent direct text usage."""
load_dotenv()
Expand Down Expand Up @@ -116,6 +117,7 @@ def test_base_agent_direct_text():
agent.dispose()


@pytest.mark.tofix
@pytest.mark.asyncio
async def test_base_agent_async_text():
"""Test BaseAgent async text usage."""
Expand Down Expand Up @@ -148,6 +150,7 @@ async def test_base_agent_async_text():
agent.dispose()


@pytest.mark.tofix
@pytest.mark.module
@pytest.mark.asyncio
async def test_base_agent_module_text():
Expand Down Expand Up @@ -233,6 +236,7 @@ async def test_base_agent_module_text():
("cerebras::llama-3.3-70b", "cerebras"),
],
)
@pytest.mark.tofix
def test_base_agent_providers(model, provider):
"""Test BaseAgent with different providers."""
load_dotenv()
Expand Down Expand Up @@ -266,6 +270,7 @@ def test_base_agent_providers(model, provider):
agent.dispose()


@pytest.mark.tofix
def test_base_agent_memory():
"""Test BaseAgent with memory/RAG."""
load_dotenv()
Expand Down Expand Up @@ -365,6 +370,7 @@ def dispose(self):
pass


@pytest.mark.tofix
def test_mock_agent():
"""Test mock agent for CI without API keys."""
# Create mock agent
Expand Down Expand Up @@ -393,6 +399,7 @@ def test_mock_agent():
agent.dispose()


@pytest.mark.tofix
def test_base_agent_conversation_history():
"""Test that conversation history is properly maintained."""
load_dotenv()
Expand Down Expand Up @@ -455,6 +462,7 @@ def test_base_agent_conversation_history():
agent.dispose()


@pytest.mark.tofix
def test_base_agent_history_with_tools():
"""Test conversation history with tool calls."""
load_dotenv()
Expand Down
7 changes: 7 additions & 0 deletions dimos/agents/test_conversation_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
logger = logging.getLogger(__name__)


@pytest.mark.tofix
def test_conversation_history_basic():
"""Test basic conversation history functionality."""
load_dotenv()
Expand Down Expand Up @@ -88,6 +89,7 @@ def test_conversation_history_basic():
agent.dispose()


@pytest.mark.tofix
def test_conversation_history_with_images():
"""Test conversation history with multimodal content."""
load_dotenv()
Expand Down Expand Up @@ -148,6 +150,7 @@ def test_conversation_history_with_images():
agent.dispose()


@pytest.mark.tofix
def test_conversation_history_trimming():
"""Test that conversation history is trimmed to max size."""
load_dotenv()
Expand Down Expand Up @@ -206,6 +209,7 @@ def test_conversation_history_trimming():
agent.dispose()


@pytest.mark.tofix
def test_conversation_history_with_tools():
"""Test conversation history with tool calls."""
load_dotenv()
Expand Down Expand Up @@ -264,6 +268,7 @@ class TestSkillLibrary(SkillLibrary):
agent.dispose()


@pytest.mark.tofix
def test_conversation_thread_safety():
"""Test that conversation history is thread-safe."""
load_dotenv()
Expand Down Expand Up @@ -297,6 +302,7 @@ async def run_concurrent():
agent.dispose()


@pytest.mark.tofix
def test_conversation_history_formats():
"""Test ConversationHistory formatting methods."""
load_dotenv()
Expand Down Expand Up @@ -355,6 +361,7 @@ def test_conversation_history_formats():
agent.dispose()


@pytest.mark.tofix
@pytest.mark.timeout(30) # Add timeout to prevent hanging
def test_conversation_edge_cases():
"""Test edge cases in conversation history."""
Expand Down
4 changes: 4 additions & 0 deletions dimos/agents/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from dimos.agents.modules.gateway import UnifiedGatewayClient


@pytest.mark.tofix
@pytest.mark.asyncio
async def test_gateway_basic():
"""Test basic gateway functionality."""
Expand Down Expand Up @@ -69,6 +70,7 @@ async def test_gateway_basic():
gateway.close()


@pytest.mark.tofix
@pytest.mark.asyncio
async def test_gateway_streaming():
"""Test gateway streaming functionality."""
Expand Down Expand Up @@ -109,6 +111,7 @@ async def test_gateway_streaming():
gateway.close()


@pytest.mark.tofix
@pytest.mark.asyncio
async def test_gateway_tools():
"""Test gateway can pass tool definitions to LLM and get responses."""
Expand Down Expand Up @@ -153,6 +156,7 @@ async def test_gateway_tools():
gateway.close()


@pytest.mark.tofix
@pytest.mark.asyncio
async def test_gateway_providers():
"""Test gateway with different providers."""
Expand Down
2 changes: 2 additions & 0 deletions dimos/agents/test_simple_agent_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def clear(self):
self.responses = []


@pytest.mark.tofix
@pytest.mark.module
@pytest.mark.asyncio
@pytest.mark.parametrize(
Expand Down Expand Up @@ -150,6 +151,7 @@ async def test_simple_agent_module(model, provider):
dimos.shutdown()


@pytest.mark.tofix
@pytest.mark.module
@pytest.mark.asyncio
async def test_mock_agent_module():
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,11 @@ markers = [
"ros: depend on ros",
"lcm: tests that run actual LCM bus (can't execute in CI)",
"module: tests that need to run directly as modules",
"gpu: tests that require GPU"
"gpu: tests that require GPU",
"tofix: temporarily disabled test"
]

addopts = "-v -p no:warnings -ra --color=yes -m 'not vis and not benchmark and not exclude and not tool and not needsdata and not lcm and not ros and not heavy and not gpu and not module'"
addopts = "-v -p no:warnings -ra --color=yes -m 'not vis and not benchmark and not exclude and not tool and not needsdata and not lcm and not ros and not heavy and not gpu and not module and not tofix'"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"

Expand Down