From 7c79515cf7ca2802bd5c5c3e9a81fe46a43e2b37 Mon Sep 17 00:00:00 2001 From: Liang Jiaqing Date: Wed, 21 Oct 2026 17:57:30 +0800 Subject: [PATCH] fix: detect malformed DSML closing tags near response end --- ga.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ga.py b/ga.py index 465190e2..c3a93ba2 100644 --- a/ga.py +++ b/ga.py @@ -476,7 +476,7 @@ class GenericAgentHandler(BaseHandler): return self._retry_or_exit("[ERROR] Blank response, regenerate and tooluse") if '[!!! 流异常中断' in content[-100:] or '!!!Error:' in content[50:][-100:] or (content.endswith('') and len(content) < 100): return self._retry_or_exit("[ERROR] Incomplete response. Regenerate and tooluse.") - if content.rstrip().endswith(''): + if ''): return self._retry_or_exit("[ERROR] Tool call format invalid; no tool was called. Regenerate using proper tool calls.") if 'max_tokens !!!]' in content[-100:]: return self._retry_or_exit("[ERROR] max_tokens limit reached. Use multi small steps to do it.")