diff --git a/ai-hub/app/core/orchestration/stream.py b/ai-hub/app/core/orchestration/stream.py index 48d4db7..8cb7092 100644 --- a/ai-hub/app/core/orchestration/stream.py +++ b/ai-hub/app/core/orchestration/stream.py @@ -60,10 +60,11 @@ yield {"type": "reasoning", "content": turn_header} self.tag_buffer = "" - strip_boilerplate = r"(?i)Strategy: Executing orchestrated tasks in progress\.*" + # Note: (?i) MUST be at the start of the regex string in Python 3.11+ + strip_boilerplate = r"Strategy:\s*Executing\s*orchestrated\s*tasks\s*in\s*progress\.*" # Separate boilerplate strategy from real content - if re.fullmatch(rf"\s*{strip_boilerplate}\s*", strategy_text): + if re.fullmatch(rf"(?i)\s*{strip_boilerplate}\s*", strategy_text): yield {"type": "reasoning", "content": strategy_text} else: processed = self._apply_turn_header(strategy_text)