🧪 QA: Add test for load_knowledge_base edge case#127
🧪 QA: Add test for load_knowledge_base edge case#127daggerstuff wants to merge 1 commit intostagingfrom
Conversation
Co-authored-by: daggerstuff <261005129+daggerstuff@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideAdds focused tests for EmbeddingAgentService.load_knowledge_base covering availability, success, and exception paths, and documents a QA pattern for patching module-level flags used by EmbeddingAgentService. Sequence diagram for EmbeddingAgentService.load_knowledge_base test coveragesequenceDiagram
participant TestKnowledgeBase
participant PatchPrimaryFlag as Patch_api_embedding_agent_flag
participant PatchFallbackFlag as Patch_app_api_embedding_agent_flag
participant EmbeddingAgentService
participant ModuleFlag as EmbeddingAgentModuleFlag
TestKnowledgeBase->>PatchPrimaryFlag: apply_patch(create_true)
TestKnowledgeBase->>PatchFallbackFlag: apply_patch(create_true)
TestKnowledgeBase->>EmbeddingAgentService: instantiate_service()
rect rgb(230,230,255)
TestKnowledgeBase->>ModuleFlag: set_available_true()
TestKnowledgeBase->>EmbeddingAgentService: load_knowledge_base()
EmbeddingAgentService->>ModuleFlag: read_available_flag()
EmbeddingAgentService-->>TestKnowledgeBase: return_loaded_knowledge_base()
end
rect rgb(230,255,230)
TestKnowledgeBase->>ModuleFlag: set_available_false()
TestKnowledgeBase->>EmbeddingAgentService: load_knowledge_base()
EmbeddingAgentService->>ModuleFlag: read_available_flag()
EmbeddingAgentService-->>TestKnowledgeBase: return_none_or_skip()
end
rect rgb(255,230,230)
TestKnowledgeBase->>ModuleFlag: set_available_true()
TestKnowledgeBase->>EmbeddingAgentService: load_knowledge_base()
EmbeddingAgentService->>ModuleFlag: read_available_flag()
EmbeddingAgentService->>EmbeddingAgentService: raise_internal_exception()
EmbeddingAgentService-->>TestKnowledgeBase: propagate_exception()
end
Class diagram for EmbeddingAgentService and new TestKnowledgeBase testsclassDiagram
class EmbeddingAgentService {
+bool knowledge_base_available_flag
+load_knowledge_base() KnowledgeBase
}
class EmbeddingAgentModuleFlag {
+bool knowledge_base_available
}
class TestKnowledgeBase {
+setup_method() void
+test_load_knowledge_base_available() void
+test_load_knowledge_base_not_available() void
+test_load_knowledge_base_exception() void
}
TestKnowledgeBase ..> EmbeddingAgentService : uses
EmbeddingAgentService ..> EmbeddingAgentModuleFlag : reads
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📝 WalkthroughWalkthroughAdded test coverage for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Hey - I've left some high level feedback:
- The repeated nested patching of
CLINICAL_EMBEDDER_AVAILABLEacrossapi.embedding_agent.serviceandapp.api.embedding_agent.servicemakes the tests a bit noisy; consider extracting a small helper or fixture (e.g.,with_clinical_embedder_available) or usingExitStackto centralize and reuse this pattern. - To make the tests more intention-revealing, you could avoid directly manipulating the private attributes
_clinical_embedderand_knowledge_itemsby either exposing a small test hook or verifying behavior via the public interface (e.g., inspecting the return values of methods that depend on the loaded knowledge base).
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The repeated nested patching of `CLINICAL_EMBEDDER_AVAILABLE` across `api.embedding_agent.service` and `app.api.embedding_agent.service` makes the tests a bit noisy; consider extracting a small helper or fixture (e.g., `with_clinical_embedder_available`) or using `ExitStack` to centralize and reuse this pattern.
- To make the tests more intention-revealing, you could avoid directly manipulating the private attributes `_clinical_embedder` and `_knowledge_items` by either exposing a small test hook or verifying behavior via the public interface (e.g., inspecting the return values of methods that depend on the loaded knowledge base).Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7186ed3261
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| def test_load_knowledge_base_available(self, config: EmbeddingAgentConfig): | ||
| """Test loading when clinical embedder is available.""" | ||
| with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True): |
There was a problem hiding this comment.
Patch a real module path for clinical embedder flag
The target app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE is not importable in this repository, and patch(..., create=True) does not create missing modules—it only allows missing attributes. As a result, this test raises ModuleNotFoundError: No module named 'app' before reaching the assertions, so the new knowledge-base coverage fails in the default test environment. Patch only the importable module (api.embedding_agent.service...) or guard the alternate namespace without importing a nonexistent package.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds unit test coverage for EmbeddingAgentService.load_knowledge_base() edge cases (clinical embedder unavailable, successful load, and exception during load) and documents a QA pattern for patching module-level flags.
Changes:
- Added
TestKnowledgeBasetest cases forload_knowledge_base()behaviors. - Added a QA note describing how to patch module-level availability flags in tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| api/embedding_agent/tests/test_service.py | Adds tests covering load_knowledge_base() return values and state updates under different conditions. |
| .Jules/qa.md | Adds a documented pattern for mocking module-level variables in tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True): | ||
| with patch('api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True): | ||
| with patch.object(EmbeddingAgentService, '_initialize_clinical_embedder'): | ||
| service = EmbeddingAgentService(config) | ||
| service._clinical_embedder = MagicMock() | ||
| service._clinical_embedder.process_all_knowledge.return_value = (["item1", "item2"], None) | ||
|
|
||
| assert service.load_knowledge_base() == 2 | ||
| assert service._knowledge_items == ["item1", "item2"] | ||
|
|
||
| def test_load_knowledge_base_exception(self, config: EmbeddingAgentConfig): | ||
| """Test exception handling during knowledge base loading.""" | ||
| with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True): | ||
| with patch('api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True): | ||
| with patch.object(EmbeddingAgentService, '_initialize_clinical_embedder'): | ||
| service = EmbeddingAgentService(config) | ||
| service._clinical_embedder = MagicMock() | ||
| service._clinical_embedder.process_all_knowledge.side_effect = Exception("Test error") | ||
|
|
||
| assert service.load_knowledge_base() == 0 |
There was a problem hiding this comment.
patch('app.api.embedding_agent.service...') will raise ModuleNotFoundError unless an app package is importable. The repo doesn't contain an app/ package, so this makes the tests environment-dependent/flaky. Patch only the module actually used by EmbeddingAgentService (e.g., api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE, ideally via patch.object(api.embedding_agent.service, ...)) and drop the app.api... patch (or create an explicit alias in sys.modules if you truly need both).
| with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True): | |
| with patch('api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True): | |
| with patch.object(EmbeddingAgentService, '_initialize_clinical_embedder'): | |
| service = EmbeddingAgentService(config) | |
| service._clinical_embedder = MagicMock() | |
| service._clinical_embedder.process_all_knowledge.return_value = (["item1", "item2"], None) | |
| assert service.load_knowledge_base() == 2 | |
| assert service._knowledge_items == ["item1", "item2"] | |
| def test_load_knowledge_base_exception(self, config: EmbeddingAgentConfig): | |
| """Test exception handling during knowledge base loading.""" | |
| with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True): | |
| with patch('api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True): | |
| with patch.object(EmbeddingAgentService, '_initialize_clinical_embedder'): | |
| service = EmbeddingAgentService(config) | |
| service._clinical_embedder = MagicMock() | |
| service._clinical_embedder.process_all_knowledge.side_effect = Exception("Test error") | |
| assert service.load_knowledge_base() == 0 | |
| with patch.object(api.embedding_agent.service, "CLINICAL_EMBEDDER_AVAILABLE", True): | |
| with patch.object(EmbeddingAgentService, '_initialize_clinical_embedder'): | |
| service = EmbeddingAgentService(config) | |
| service._clinical_embedder = MagicMock() | |
| service._clinical_embedder.process_all_knowledge.return_value = (["item1", "item2"], None) | |
| assert service.load_knowledge_base() == 2 | |
| assert service._knowledge_items == ["item1", "item2"] | |
| def test_load_knowledge_base_exception(self, config: EmbeddingAgentConfig): | |
| """Test exception handling during knowledge base loading.""" | |
| with patch.object(api.embedding_agent.service, "CLINICAL_EMBEDDER_AVAILABLE", True): | |
| with patch.object(EmbeddingAgentService, '_initialize_clinical_embedder'): | |
| service = EmbeddingAgentService(config) | |
| service._clinical_embedder = MagicMock() | |
| service._clinical_embedder.process_all_knowledge.side_effect = Exception("Test error") | |
| assert service.load_knowledge_base() == 0 |
| @@ -1 +1,2 @@ | |||
| ## 2026-03-27 - Mocking File I/O for TranscriptCorrector | Pattern: Explicitly mock Path.exists and builtins.open when initializing utilities that read config files to avoid FileNotFoundError | Action: Use @patch('pathlib.Path.exists', return_value=True) and @patch('builtins.open', new_callable=mock_open) with a valid JSON string | |||
| ## 2026-04-02 - Mocking Module-Level Variables for EmbeddingAgentService | Pattern: Patching module-level flags requires defensive mocking across multiple potential namespaces (e.g., `api.embedding_agent...` and `app.api.embedding_agent...` with `create=True`) depending on test runner execution path | Action: Apply `patch` directly to the module attribute path and add a fallback patch with `create=True` when testing behavior dependent on global flags. | |||
There was a problem hiding this comment.
This QA note recommends patching app.api.embedding_agent..., but the repository does not contain an app package, so this guidance is likely incorrect and may lead to brittle tests. Consider updating the note to recommend patching the real import path used in tests/runtime (e.g., api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE) and avoid suggesting fallback patches to non-importable module paths.
| ## 2026-04-02 - Mocking Module-Level Variables for EmbeddingAgentService | Pattern: Patching module-level flags requires defensive mocking across multiple potential namespaces (e.g., `api.embedding_agent...` and `app.api.embedding_agent...` with `create=True`) depending on test runner execution path | Action: Apply `patch` directly to the module attribute path and add a fallback patch with `create=True` when testing behavior dependent on global flags. | |
| ## 2026-04-02 - Mocking Module-Level Variables for EmbeddingAgentService | Pattern: Patching module-level flags should target the actual import path used at runtime (for example, `api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE`) rather than attempting to patch fallback or non-importable module namespaces | Action: Apply `patch` directly to the concrete module attribute path used by the code under test (e.g., `api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE`) when testing behavior dependent on global flags. |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
api/embedding_agent/tests/test_service.py (2)
296-300: Inconsistent patching pattern compared to other tests.This test uses only a single
patch.object()call, whiletest_load_knowledge_base_availableandtest_load_knowledge_base_exceptiondefensively patch bothapi.embedding_agent.serviceandapp.api.embedding_agent.servicenamespaces. The QA checklist in.Jules/qa.mdrecommends this defensive approach for test runner variability.Consider aligning this test with the documented pattern for consistency:
♻️ Proposed fix for consistency
def test_load_knowledge_base_not_available(self, config: EmbeddingAgentConfig): """Test loading when clinical embedder is not available.""" - with patch.object(api.embedding_agent.service, 'CLINICAL_EMBEDDER_AVAILABLE', False): - service = EmbeddingAgentService(config) - assert service.load_knowledge_base() == 0 + with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', False, create=True): + with patch.object(api.embedding_agent.service, 'CLINICAL_EMBEDDER_AVAILABLE', False): + service = EmbeddingAgentService(config) + assert service.load_knowledge_base() == 0🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api/embedding_agent/tests/test_service.py` around lines 296 - 300, The test test_load_knowledge_base_not_available should patch CLINICAL_EMBEDDER_AVAILABLE defensively in both module namespaces like the other tests; update the test to use patch.object on both api.embedding_agent.service and app.api.embedding_agent.service to set CLINICAL_EMBEDDER_AVAILABLE to False before instantiating EmbeddingAgentService and calling load_knowledge_base so the environment matches test_load_knowledge_base_available and test_load_knowledge_base_exception.
302-323: Test coverage for available and exception cases looks solid.The tests correctly verify:
- Return value matches
len(knowledge_items)when successful_knowledge_itemsstate is updated after loading- Exception during
process_all_knowledge()returns 0 gracefullyThe triple-nested patch setup is duplicated between both tests. If you'd like to reduce this duplication, consider extracting a helper or using
pytest.fixturewith the patches, but this is optional for now.♻️ Optional: Extract shared patch setup to reduce duplication
from contextlib import contextmanager `@contextmanager` def patch_clinical_embedder_available(): """Context manager for patching CLINICAL_EMBEDDER_AVAILABLE to True.""" with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True): with patch('api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True): with patch.object(EmbeddingAgentService, '_initialize_clinical_embedder'): yieldThen use it in tests:
def test_load_knowledge_base_available(self, config: EmbeddingAgentConfig): with patch_clinical_embedder_available(): service = EmbeddingAgentService(config) # ... rest of test🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api/embedding_agent/tests/test_service.py` around lines 302 - 323, Extract the repeated triple-patch setup used in test_load_knowledge_base_available and test_load_knowledge_base_exception into a shared helper (either a contextmanager named patch_clinical_embedder_available or a pytest.fixture) that patches CLINICAL_EMBEDDER_AVAILABLE in both app.api.embedding_agent.service and api.embedding_agent.service and mocks EmbeddingAgentService._initialize_clinical_embedder; then update both tests to call the helper before instantiating EmbeddingAgentService and setting service._clinical_embedder, ensuring the behavior of process_all_knowledge (return value or side_effect) remains the same.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@api/embedding_agent/tests/test_service.py`:
- Around line 296-300: The test test_load_knowledge_base_not_available should
patch CLINICAL_EMBEDDER_AVAILABLE defensively in both module namespaces like the
other tests; update the test to use patch.object on both
api.embedding_agent.service and app.api.embedding_agent.service to set
CLINICAL_EMBEDDER_AVAILABLE to False before instantiating EmbeddingAgentService
and calling load_knowledge_base so the environment matches
test_load_knowledge_base_available and test_load_knowledge_base_exception.
- Around line 302-323: Extract the repeated triple-patch setup used in
test_load_knowledge_base_available and test_load_knowledge_base_exception into a
shared helper (either a contextmanager named patch_clinical_embedder_available
or a pytest.fixture) that patches CLINICAL_EMBEDDER_AVAILABLE in both
app.api.embedding_agent.service and api.embedding_agent.service and mocks
EmbeddingAgentService._initialize_clinical_embedder; then update both tests to
call the helper before instantiating EmbeddingAgentService and setting
service._clinical_embedder, ensuring the behavior of process_all_knowledge
(return value or side_effect) remains the same.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 95a972f3-12ba-48ac-af3c-48604e49ef4a
📒 Files selected for processing (2)
.Jules/qa.mdapi/embedding_agent/tests/test_service.py
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".Jules/qa.md">
<violation number="1" location=".Jules/qa.md:2">
P2: This QA note recommends a "fallback patch" with `create=True` targeting `app.api.embedding_agent...`, but `create=True` does not create missing modules — only missing attributes. Since no `app` package exists, following this guidance produces `ModuleNotFoundError`. Update the note to recommend patching only the real import path (`api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE`).</violation>
</file>
<file name="api/embedding_agent/tests/test_service.py">
<violation number="1" location="api/embedding_agent/tests/test_service.py:304">
P1: This patch target points to a non-existent module path (`app.api...`) and can fail the test with `ModuleNotFoundError`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| def test_load_knowledge_base_available(self, config: EmbeddingAgentConfig): | ||
| """Test loading when clinical embedder is available.""" | ||
| with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True): |
There was a problem hiding this comment.
P1: This patch target points to a non-existent module path (app.api...) and can fail the test with ModuleNotFoundError.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At api/embedding_agent/tests/test_service.py, line 304:
<comment>This patch target points to a non-existent module path (`app.api...`) and can fail the test with `ModuleNotFoundError`.</comment>
<file context>
@@ -288,6 +290,39 @@ def test_empty_batch(self, service: EmbeddingAgentService):
+
+ def test_load_knowledge_base_available(self, config: EmbeddingAgentConfig):
+ """Test loading when clinical embedder is available."""
+ with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True):
+ with patch('api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True):
+ with patch.object(EmbeddingAgentService, '_initialize_clinical_embedder'):
</file context>
| with patch('app.api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True, create=True): | |
| with patch('api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE', True): |
| @@ -1 +1,2 @@ | |||
| ## 2026-03-27 - Mocking File I/O for TranscriptCorrector | Pattern: Explicitly mock Path.exists and builtins.open when initializing utilities that read config files to avoid FileNotFoundError | Action: Use @patch('pathlib.Path.exists', return_value=True) and @patch('builtins.open', new_callable=mock_open) with a valid JSON string | |||
| ## 2026-04-02 - Mocking Module-Level Variables for EmbeddingAgentService | Pattern: Patching module-level flags requires defensive mocking across multiple potential namespaces (e.g., `api.embedding_agent...` and `app.api.embedding_agent...` with `create=True`) depending on test runner execution path | Action: Apply `patch` directly to the module attribute path and add a fallback patch with `create=True` when testing behavior dependent on global flags. | |||
There was a problem hiding this comment.
P2: This QA note recommends a "fallback patch" with create=True targeting app.api.embedding_agent..., but create=True does not create missing modules — only missing attributes. Since no app package exists, following this guidance produces ModuleNotFoundError. Update the note to recommend patching only the real import path (api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .Jules/qa.md, line 2:
<comment>This QA note recommends a "fallback patch" with `create=True` targeting `app.api.embedding_agent...`, but `create=True` does not create missing modules — only missing attributes. Since no `app` package exists, following this guidance produces `ModuleNotFoundError`. Update the note to recommend patching only the real import path (`api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE`).</comment>
<file context>
@@ -1 +1,2 @@
## 2026-03-27 - Mocking File I/O for TranscriptCorrector | Pattern: Explicitly mock Path.exists and builtins.open when initializing utilities that read config files to avoid FileNotFoundError | Action: Use @patch('pathlib.Path.exists', return_value=True) and @patch('builtins.open', new_callable=mock_open) with a valid JSON string
+## 2026-04-02 - Mocking Module-Level Variables for EmbeddingAgentService | Pattern: Patching module-level flags requires defensive mocking across multiple potential namespaces (e.g., `api.embedding_agent...` and `app.api.embedding_agent...` with `create=True`) depending on test runner execution path | Action: Apply `patch` directly to the module attribute path and add a fallback patch with `create=True` when testing behavior dependent on global flags.
</file context>
| ## 2026-04-02 - Mocking Module-Level Variables for EmbeddingAgentService | Pattern: Patching module-level flags requires defensive mocking across multiple potential namespaces (e.g., `api.embedding_agent...` and `app.api.embedding_agent...` with `create=True`) depending on test runner execution path | Action: Apply `patch` directly to the module attribute path and add a fallback patch with `create=True` when testing behavior dependent on global flags. | |
| ## 2026-04-02 - Mocking Module-Level Variables for EmbeddingAgentService | Pattern: Patching module-level flags should target the actual import path used at runtime (for example, `api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE`) rather than attempting to patch fallback or non-importable module namespaces | Action: Apply `patch` directly to the concrete module attribute path used by the code under test (e.g., `api.embedding_agent.service.CLINICAL_EMBEDDER_AVAILABLE`) when testing behavior dependent on global flags. |
💡 What: Added
TestKnowledgeBasetotest_service.pywith cases forload_knowledge_basemethod (available, not available, exception cases).🎯 Why: Covers missing edge cases and improves coverage for the
EmbeddingAgentService.✅ Verification: Runs successfully via pytest.
PR created automatically by Jules for task 5471369406424211851 started by @daggerstuff
Summary by Sourcery
Add tests for EmbeddingAgentService knowledge base loading behavior across availability and error scenarios.
Documentation:
Tests:
Summary by cubic
Add tests for
EmbeddingAgentService.load_knowledge_baseto cover when the clinical embedder is unavailable, available, and when it raises an exception. Also update.Jules/qa.mdwith guidance on patching theCLINICAL_EMBEDDER_AVAILABLEflag in bothapi.embedding_agent.serviceandapp.api.embedding_agent.service.Written for commit 7186ed3. Summary will update on new commits.
Summary by CodeRabbit
Tests
Documentation