Skip to content

Commit dd6ca80

Browse files
committed
fix link_resolver tests
Signed-off-by: phernandez <paul@basicmachines.co>
1 parent ae3eeb0 commit dd6ca80

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/basic_memory/services/link_resolver.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ async def resolve_link(
4949

5050
# 2. Try exact title match
5151
found = await self.entity_repository.get_by_title(clean_text)
52-
if found and len(found) == 1:
52+
if found:
53+
# Return first match if there are duplicates (consistent behavior)
5354
entity = found[0]
5455
logger.debug(f"Found title match: {entity.title}")
5556
return entity
@@ -112,5 +113,8 @@ def _normalize_link_text(self, link_text: str) -> Tuple[str, Optional[str]]:
112113
text, alias = text.split("|", 1)
113114
text = text.strip()
114115
alias = alias.strip()
116+
else:
117+
# Strip whitespace from text even if no alias
118+
text = text.strip()
115119

116120
return text, alias

0 commit comments

Comments
 (0)