From 94569b327276559c05a788fe13a0c8116dc89362 Mon Sep 17 00:00:00 2001 From: GuDaStudio Date: Wed, 19 Nov 2025 19:10:22 +0800 Subject: [PATCH] =?UTF-8?q?v0.7.1=EF=BC=9A=E5=85=81=E8=AE=B8`reconnecting`?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=BB=A7=E7=BB=AD=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/codexmcp/server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/codexmcp/server.py b/src/codexmcp/server.py index 7824f51..55987ea 100644 --- a/src/codexmcp/server.py +++ b/src/codexmcp/server.py @@ -216,11 +216,12 @@ async def codex( if line_dict.get("thread_id") is not None: thread_id = line_dict.get("thread_id") if "fail" in line_dict.get("type", ""): - success = False + success = False if len(agent_messages) == 0 else success err_message = "codex error: " + line_dict.get("error", {}).get("message", "") - break + if "reconnecting" not in err_message.lower(): + break if "error" in line_dict.get("type", ""): - success = False + success = False if len(agent_messages) == 0 else success err_message = "codex error: " + line_dict.get("message", "") except json.JSONDecodeError as error: # Improved error handling: include problematic line