fix: fix a bug in regular expression exception processing (#734)

* fix a bug in regular expression exception precessing

* fix ci

* fix
This commit is contained in:
Yuante Li
2025-04-01 16:54:05 +08:00
committed by GitHub
parent 9a6e18ad82
commit c5dcd3b704
+2 -3
View File
@@ -15,6 +15,7 @@ from pathlib import Path
from types import ModuleType
from typing import Union
from rdagent.log import rdagent_logger as logger
from rdagent.oai.llm_conf import LLM_SETTINGS
from rdagent.utils.agent.tpl import T
@@ -139,9 +140,7 @@ def filter_redundant_text(stdout: str) -> str:
if not needs_sub:
break
filtered_stdout = re.sub(r"\s*\n\s*", "\n", filtered_stdout)
except re.error as e: # sometime the generated regex pattern is invalid and yield exception.
from rdagent.log import rdagent_logger as logger
except Exception as e:
logger.error(f"Error in filtering progress bar: due to {e}")
return filtered_stdout