1
0
mirror of https://github.com/GuDaStudio/codexmcp.git synced 2026-02-04 01:50:40 +08:00

v0.7.4:忽略Reconnecting... X/Y类型的错误(重连尝试警告) (#23)

This commit is contained in:
Menghuan
2025-12-01 10:29:53 +08:00
committed by GitHub
parent c258d6b73b
commit d8debc6182
3 changed files with 8 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "codexmcp"
version = "0.1.0"
version = "0.7.4"
description = "FastMCP server wrapping the Codex CLI."
readme = "README.md"
requires-python = ">=3.12"

View File

@@ -5,6 +5,7 @@ from __future__ import annotations
import json
import os
import queue
import re
import subprocess
import threading
import uuid
@@ -219,8 +220,11 @@ async def codex(
success = False if len(agent_messages) == 0 else success
err_message = "codex error: " + line_dict.get("error", {}).get("message", "")
if "error" in line_dict.get("type", ""):
success = False if len(agent_messages) == 0 else success
err_message = "codex error: " + line_dict.get("message", "")
error_msg = line_dict.get("message", "")
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
err_message = "codex error: " + error_msg
except json.JSONDecodeError as error:
# Improved error handling: include problematic line
err_message = line

2
uv.lock generated
View File

@@ -114,7 +114,7 @@ wheels = [
[[package]]
name = "codexmcp"
version = "0.1.0"
version = "0.7.4"
source = { editable = "." }
dependencies = [
{ name = "mcp", extra = ["cli"] },