diff --git a/run_agent.py b/run_agent.py index 48790f344d8..6e39ccfbb56 100644 --- a/run_agent.py +++ b/run_agent.py @@ -1019,7 +1019,15 @@ class AIAgent: return False if stripped.endswith("```"): return True - return stripped[-1] in '.!?:)"\']}。!?:)】」』》' + if stripped.endswith('^'): + return True + last = stripped[-1] + if last in '.!?:)"\']}。!?:)】」』》^': + return True + # Emoji ranges (Misc Symbols, Dingbats, Emoticons, Supplemental, etc.) + if ord(last) >= 0x1F300: + return True + return False def _is_ollama_glm_backend(self) -> bool: """Detect the narrow backend family affected by Ollama/GLM stop misreports."""