mirror of
https://github.com/GuDaStudio/codexmcp.git
synced 2026-02-05 02:00:24 +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:
@@ -241,7 +241,7 @@ async def codex(
|
|||||||
if "error" in line_dict.get("type", ""):
|
if "error" in line_dict.get("type", ""):
|
||||||
error_msg = line_dict.get("message", "")
|
error_msg = line_dict.get("message", "")
|
||||||
import re
|
import re
|
||||||
is_reconnecting = bool(re.match(r'^Reconnecting\.\.\.\s+\d+/\d+$', error_msg))
|
is_reconnecting = bool(re.match(r'^Reconnecting\.\.\.\s+\d+/\d+', error_msg))
|
||||||
|
|
||||||
if not is_reconnecting:
|
if not is_reconnecting:
|
||||||
success = False if len(agent_messages) == 0 else success
|
success = False if len(agent_messages) == 0 else success
|
||||||
|
|||||||
Reference in New Issue
Block a user