From 21871c5ec12f421d544b4fcb363f79cf79641aa4 Mon Sep 17 00:00:00 2001 From: Daniel Nichols Date: Tue, 4 Nov 2025 09:01:36 -0800 Subject: [PATCH] add extra pass when cleaning outputs --- generate/clean-outputs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generate/clean-outputs.py b/generate/clean-outputs.py index e8657b6..610eb00 100644 --- a/generate/clean-outputs.py +++ b/generate/clean-outputs.py @@ -22,6 +22,11 @@ def clean_output(prompt: str, output: str) -> str: if output.strip().startswith(last_line_of_prompt): output = output.replace(last_line_of_prompt, '', 1) + # we expect outputs to not start with the opening { bracket. We add that later in the drivers; + # remove it here if present + if output.strip().startswith('{'): + output = output.replace('{', '', 1) + if has_balanced_brackets("{" + output + "}"): output = output + '}'