From 4d15bdd466ab6c75b2d2b9d624dcfee741023511 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Mon, 2 Feb 2026 03:02:37 -0300 Subject: [PATCH] atlasbot: strip follow-up meta phrasing --- atlasbot/engine/answerer.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index 2c3b4a9..af7d92f 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -801,8 +801,29 @@ class AnswerEngine: tag="followup_fix", ) reply = await self._dedup_reply(reply, plan, call_llm, tag="dedup_followup") + reply = _strip_followup_meta(reply) return reply + +def _strip_followup_meta(reply: str) -> str: + cleaned = reply.strip() + if not cleaned: + return cleaned + prefixes = [ + "The draft is correct based on the provided context.", + "The draft is correct based on the context.", + "The draft is correct based on the provided evidence.", + "The draft is correct.", + "Based on the provided context,", + "Based on the context,", + "Based on the provided evidence,", + ] + for prefix in prefixes: + if cleaned.lower().startswith(prefix.lower()): + cleaned = cleaned[len(prefix) :].lstrip(" .") + break + return cleaned + async def _select_claims( self, question: str,