From a775c7e55564fa8cc3216b62529c56d50cfa605d Mon Sep 17 00:00:00 2001 From: Dongge Liu Date: Mon, 16 Dec 2024 15:07:54 +1100 Subject: [PATCH] Ignore comment-only build script --- agent/base_agent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agent/base_agent.py b/agent/base_agent.py index e5e64b6ed..a0a64c140 100644 --- a/agent/base_agent.py +++ b/agent/base_agent.py @@ -75,6 +75,9 @@ def _filter_code(self, raw_code_block: str) -> str: line for line in raw_code_block.splitlines() if not line.strip().startswith('```') ] + # Sometimes LLM returns a build script containing only comments. + if all(line.strip().startswith('#') for line in filtered_lines): + return '' filtered_code_block = '\n'.join(filtered_lines) return filtered_code_block