Conversation
WalkthroughSkips Moondream local tests via a pytest skip marker, converts many Moondream unit tests to async, bumps dev dependency Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*test*.py📄 CodeRabbit inference engine (.cursor/rules/python.mdc)
Files:
**/*.py📄 CodeRabbit inference engine (.cursor/rules/python.mdc)
Files:
🧠 Learnings (1)📚 Learning: 2025-11-24T17:04:43.030ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
plugins/moondream/tests/test_moondream_local.py (1)
32-32: Consider skipping only integration tests instead of the entire class.The class contains unit tests (lines 182-293) for device detection logic that use monkeypatching and don't load models—these should execute quickly. Skipping the entire class prevents these fast unit tests from running.
🔎 Alternative approach: Skip only integration tests
Remove the class-level skip decorator and rely on pytest's marker filtering instead:
-@pytest.mark.skip("Skip Moondream local tests because they take too long to run") class TestMoondreamLocalProcessor: """Test cases for MoondreamLocalProcessor."""Then run tests with:
# Run only fast unit tests (skip integration tests) pytest plugins/moondream/tests/test_moondream_local.py -m "not integration" # Run all tests including integration tests pytest plugins/moondream/tests/test_moondream_local.pyThis preserves the ability to run fast unit tests in CI while allowing integration tests to be skipped by default using pytest marker configuration.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
plugins/moondream/tests/test_moondream_local.pypyproject.toml
🧰 Additional context used
📓 Path-based instructions (2)
**/*test*.py
📄 CodeRabbit inference engine (.cursor/rules/python.mdc)
**/*test*.py: Never mock in tests; use pytest for testing
Mark integration tests with @pytest.mark.integration decorator
@pytest.mark.asyncio is not needed - it is automatic
Files:
plugins/moondream/tests/test_moondream_local.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/python.mdc)
**/*.py: Never adjust sys.path in Python code
Never writeexcept Exception as e- use specific exception handling
Avoid using getattr, hasattr, delattr and setattr; prefer normal attribute access in Python
Docstrings should follow the Google style guide for docstrings
Files:
plugins/moondream/tests/test_moondream_local.py
🧠 Learnings (1)
📚 Learning: 2025-11-24T17:04:43.030Z
Learnt from: CR
Repo: GetStream/Vision-Agents PR: 0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-11-24T17:04:43.030Z
Learning: Applies to **/*test*.py : Mark integration tests with pytest.mark.integration decorator
Applied to files:
plugins/moondream/tests/test_moondream_local.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: unit / Test "not integration"
- GitHub Check: unit / Validate extra dependencies in "agents-core/pyproject.toml"
- GitHub Check: unit / Mypy
- GitHub Check: unit / Ruff
- GitHub Check: unit / Ruff
- GitHub Check: unit / Mypy
- GitHub Check: unit / Validate extra dependencies in "agents-core/pyproject.toml"
- GitHub Check: unit / Test "not integration"
🔇 Additional comments (1)
pyproject.toml (1)
97-97: Blockbuster version 1.5.26 is confirmed safe to use.Version 1.5.26 exists on PyPI with no known vulnerabilities or CVEs. The version bump is valid.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
plugins/moondream/tests/test_moondream.py (4)
74-77: Avoid mocking in tests per project guidelines.The project's coding guidelines explicitly state "Never mock in tests; use pytest for testing." Consider using pytest fixtures or testing against the actual implementation instead of mocking internal methods.
As per coding guidelines, never mock in tests; use pytest for testing.
92-93: Avoid mocking in tests per project guidelines.This mock violates the project's coding guidelines that state "Never mock in tests; use pytest for testing."
As per coding guidelines, never mock in tests; use pytest for testing.
220-225: Avoid mocking in tests per project guidelines.This mock violates the project's coding guidelines that explicitly state "Never mock in tests; use pytest for testing."
As per coding guidelines, never mock in tests; use pytest for testing.
242-242: Remove unnecessary@pytest.mark.asynciodecorators from integration tests.Per the project's coding guidelines,
@pytest.mark.asynciois not needed as asyncio handling is automatic. The@pytest.mark.integrationdecorator is correct and should be kept, but the@pytest.mark.asynciodecorator should be removed for consistency.As per coding guidelines, @pytest.mark.asyncio is not needed - it is automatic.
🔎 Proposed fix
@pytest.mark.integration @pytest.mark.skipif( not os.getenv("MOONDREAM_API_KEY"), reason="MOONDREAM_API_KEY not set" ) -@pytest.mark.asyncio async def test_live_detection_api():Apply similar changes to:
test_live_detection_with_annotation(Line 283)test_custom_object_detection(Line 389)test_multiple_object_detection(Line 431)Also applies to: 283-283, 389-389, 431-431
🧹 Nitpick comments (1)
plugins/smart_turn/tests/test_smart_turn.py (1)
15-16: Consider adding @pytest.mark.integration to the class.Per coding guidelines, integration tests should be marked with
@pytest.mark.integration. All three tests in this class exercise real audio processing, VAD models, and the full turn detection pipeline—characteristics of integration tests rather than unit tests. The@skip_blockbustermarker serves a different purpose (handling unavoidable blocking calls) and can coexist with the integration marker.As per coding guidelines, integration tests should be marked with the decorator.
🔎 Proposed addition
@skip_blockbuster +@pytest.mark.integration class TestSmartTurn:
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
plugins/moondream/tests/test_moondream.pyplugins/smart_turn/tests/test_smart_turn.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*test*.py
📄 CodeRabbit inference engine (.cursor/rules/python.mdc)
**/*test*.py: Never mock in tests; use pytest for testing
Mark integration tests with @pytest.mark.integration decorator
@pytest.mark.asyncio is not needed - it is automatic
Files:
plugins/smart_turn/tests/test_smart_turn.pyplugins/moondream/tests/test_moondream.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/python.mdc)
**/*.py: Never adjust sys.path in Python code
Never writeexcept Exception as e- use specific exception handling
Avoid using getattr, hasattr, delattr and setattr; prefer normal attribute access in Python
Docstrings should follow the Google style guide for docstrings
Files:
plugins/smart_turn/tests/test_smart_turn.pyplugins/moondream/tests/test_moondream.py
🧬 Code graph analysis (1)
plugins/smart_turn/tests/test_smart_turn.py (4)
agents-core/vision_agents/core/turn_detection/events.py (2)
TurnEndedEvent(29-46)TurnStartedEvent(11-25)agents-core/vision_agents/core/vad/silero.py (1)
prepare_silero_vad(87-96)conftest.py (2)
skip_blockbuster(29-46)mia_audio_16khz(193-197)tests/base_test.py (1)
mia_audio_16khz(18-58)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: unit / Test "not integration"
- GitHub Check: unit / Mypy
- GitHub Check: unit / Mypy
- GitHub Check: unit / Test "not integration"
🔇 Additional comments (4)
plugins/smart_turn/tests/test_smart_turn.py (1)
23-24: LGTM! Clean migration to pytest's tmp_path fixture.The shift from manual temporary directory management to pytest's
tmp_pathfixture improves test isolation and ensures automatic cleanup. The path conversion viaas_posix()correctly matches the string parameter expected byprepare_silero_vad.plugins/moondream/tests/test_moondream.py (3)
41-45: LGTM! Async conversion is clean.The test has been properly converted to async, and correctly omits the
@pytest.mark.asynciodecorator per the project's automatic asyncio handling.
103-130: LGTM! Annotation tests properly converted to async.All four annotation test functions have been cleanly converted to async, correctly call
await processor.close(), and properly omit the@pytest.mark.asynciodecorator.Also applies to: 133-158, 161-189, 192-212
326-332: LGTM! API key and detect_objects tests properly converted to async.All five test functions have been cleanly converted to async with proper
await processor.close()calls and no unnecessary decorators.Also applies to: 335-341, 344-348, 351-355, 358-364
tmp_pathfixture instead of direct access to the temp directoryno space left on deviceissues.blockbusterto >=1.5.26 to fix some regressions.Summary by CodeRabbit
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.