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: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2025-06-03 - Nested MagicMock Requires Full Paths
**Learning:** When testing scripts in isolation and mocking missing dependencies with `sys.modules['module'] = MagicMock()`, if the codebase imports from deeply nested submodules (like `litellm.types.utils`), mocking just the top-level `litellm` package is insufficient and raises a `ModuleNotFoundError: No module named 'litellm.types'; 'litellm' is not a package` error.
**Action:** When creating scratchpad tests that use `sys.modules` mocks, ensure you mock every part of the nested import path required by the test environment.
12 changes: 6 additions & 6 deletions helpers/skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ def _coerce_list(value: Any) -> List[str]:
if value is None:
return []
if isinstance(value, list):
return [str(v).strip() for v in value if str(v).strip()]
return [stripped for v in value if (stripped := str(v).strip())]
if isinstance(value, tuple):
return [str(v).strip() for v in list(value) if str(v).strip()]
return [stripped for v in value if (stripped := str(v).strip())]
if isinstance(value, str):
# Support comma-separated or space-delimited strings
if "," in value:
parts = [p.strip() for p in value.split(",")]
return [p for p in parts if p]
else:
parts = [p.strip() for p in re.split(r"\s+", value)]
return [p for p in parts if p]
return [str(value).strip()] if str(value).strip() else []
return value.split()
return [stripped] if (stripped := str(value).strip()) else []


def _normalize_name(name: str) -> str:
Expand Down Expand Up @@ -475,7 +475,7 @@ def search_skills(
if not q:
return []

raw_terms = [t for t in re.split(r"\s+", q) if t]
raw_terms = q.split()
terms = [
t for t in raw_terms
if len(t) >= 3 or any(ch.isdigit() for ch in t)
Expand Down