fix: show follow-up suggestions when the task model adds text around its JSON (#32323)

This commit is contained in:
G30 authored and GitHub committed 2026-10-13 16:46:17 +04:00
1 parent 99a9f60b9f
commit 1c5f101d0b
1 file changed
+1 -1
+1 -1
View File
@@ -348,7 +348,7 @@ async def follow_up_generation_template(
def parse_follow_ups(content: str, max_count: int = 5) -> list[str]:
if not isinstance(content, str):
return []
content = re.sub(r'^```(?:json)?\s*|\s*```$', '', content.strip())
content = content[content.find('{') : content.rfind('}') + 1]
try:
data = JSONCodec.loads(content)
except (ValueError, TypeError):