mirror of
https://github.com/GuDaStudio/codexmcp.git
synced 2026-02-04 01:50:40 +08:00
fix: improve reconnecting regex to match messages with error details (#36)
Remove the trailing $ anchor from the reconnecting regex pattern to properly match messages like "Reconnecting... 1/5 (error details)" instead of only matching "Reconnecting... 1/5". Fixes #22
This commit is contained in:
@@ -240,8 +240,8 @@ async def codex(
|
||||
err_message += "\n\n[codex error] " + line_dict.get("error", {}).get("message", "")
|
||||
if "error" in line_dict.get("type", ""):
|
||||
error_msg = line_dict.get("message", "")
|
||||
import re
|
||||
is_reconnecting = bool(re.match(r'^Reconnecting\.\.\.\s+\d+/\d+$', error_msg))
|
||||
import re
|
||||
is_reconnecting = bool(re.match(r'^Reconnecting\.\.\.\s+\d+/\d+', error_msg))
|
||||
|
||||
if not is_reconnecting:
|
||||
success = False if len(agent_messages) == 0 else success
|
||||
|
||||
Reference in New Issue
Block a user