mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-15 17:25:26 -04:00
Fix memory bullet extraction in service copy
Fix services.memory bullet-list extraction by grouping the bullet/number regex before the capture, and cover both memory manager copies in the regression test.
This commit is contained in:
@@ -59,8 +59,12 @@ class MemoryManager:
|
||||
line = line.strip()
|
||||
# Look for bullet points or numbered lists that might contain memories
|
||||
if re.match(r'^[-*•]|\d+\.', line):
|
||||
# Extract the text after the bullet/number
|
||||
text_match = re.match(r'^[-*•]|\d+\.\s*(.*)', line)
|
||||
# Extract the text after the bullet/number. Group both
|
||||
# markers so the capture applies to either. The previous
|
||||
# `^[-*•]|\d+\.\s*(.*)` put the group on the numbered
|
||||
# branch only, so a bullet line matched with group(1)=None
|
||||
# and crashed on .strip().
|
||||
text_match = re.match(r'^(?:[-*•]|\d+\.)\s*(.*)', line)
|
||||
if text_match:
|
||||
text = text_match.group(1).strip()
|
||||
if text:
|
||||
|
||||
Reference in New Issue
Block a user