From a9a36b4b219593369de01c3e5973e56ac02e568b Mon Sep 17 00:00:00 2001 From: Liang Jiaqing Date: Fri, 23 Oct 2026 07:54:26 +0800 Subject: [PATCH] fix: broaden DSML tail detection to independent markers --- ga.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ga.py b/ga.py index cf2e210b..15fdb71b 100644 --- a/ga.py +++ b/ga.py @@ -477,7 +477,8 @@ 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 ''): + tail = content.rstrip()[-50:] + if 'DSML' in tail and '|' in tail and tail.endswith('>'): 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.")