1
0
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:
SaladDay
2026-01-13 19:57:51 +08:00
committed by GitHub
parent 236123b158
commit e55ec64532

View File

@@ -241,7 +241,7 @@ async def codex(
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))
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