atlasbot: fix fallback fact parsing

This commit is contained in:
Brad Stein 2026-01-28 03:35:02 -03:00
parent a9d74a066f
commit eb567fda06

View File

@ -3829,9 +3829,12 @@ def _fallback_fact_answer(prompt: str, context: str) -> str:
trimmed = line.strip() trimmed = line.strip()
if not trimmed.startswith("F"): if not trimmed.startswith("F"):
continue continue
if ":" not in trimmed: match = re.match(r"^F\\d+.*?\\]:\\s*(.*)$", trimmed)
if not match:
match = re.match(r"^F\\d+:\\s*(.*)$", trimmed)
if not match:
continue continue
fact = trimmed.split(":", 1)[1].strip() fact = match.group(1).strip()
if fact.startswith("-"): if fact.startswith("-"):
fact = fact.lstrip("-").strip() fact = fact.lstrip("-").strip()
if fact: if fact: