From 39c9e006c08872e42c7f46550031c0b2f40b4024 Mon Sep 17 00:00:00 2001 From: Muhamed Fazal PS Date: Wed, 15 Jul 2026 14:31:36 +0530 Subject: [PATCH] Fix #89: Escape curly braces in context before str.format() in synthesis --- openagent_eval/synthesis/adversarial.py | 2 +- openagent_eval/synthesis/question_gen.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openagent_eval/synthesis/adversarial.py b/openagent_eval/synthesis/adversarial.py index 3b7491a..c139518 100644 --- a/openagent_eval/synthesis/adversarial.py +++ b/openagent_eval/synthesis/adversarial.py @@ -213,7 +213,7 @@ async def generate( details={"supported_types": [t.value for t in TestCaseType]}, ) - prompt = prompt_template.format(count=count, context=context.strip()) + prompt = prompt_template.format(count=count, context=context.strip().replace("{", "{{").replace("}", "}}")) try: raw_response = await self._llm.generate(prompt) diff --git a/openagent_eval/synthesis/question_gen.py b/openagent_eval/synthesis/question_gen.py index 8b629ff..9b65d9f 100644 --- a/openagent_eval/synthesis/question_gen.py +++ b/openagent_eval/synthesis/question_gen.py @@ -102,7 +102,7 @@ async def generate( prompt = _QUESTION_GENERATION_PROMPT.format( count=count, - context=context.strip(), + context=context.strip().replace("{", "{{").replace("}", "}}"), ) try: