Bug 描述
在 Windows 中文系统上运行 agent-reach doctor 时,微信公众号文章渠道会被错误地标记为 [X] 不可用,即使 mcporter 和 Exa MCP 已经正确安装且功能完全正常。
复现步骤
- 在 Windows 中文系统上安装 agent-reach
- 正确安装并配置 mcporter + Exa MCP(
mcporter config add exa https://mcp.exa.ai/mcp)
- 运行
agent-reach doctor
实际结果
- 抛出异常:
UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 in position 185: illegal multibyte sequence
- 微信公众号文章显示
[X] 需要 mcporter + Exa MCP 来搜索和阅读微信公众号文章
agent-reach doctor 状态为 8/16(实际应为 9/16)
问题根因
在 agent_reach/channels/wechat.py 的 _exa_available() 函数中:
r = subprocess.run(
[mcporter, "config", "list"],
capture_output=True, text=True, timeout=5,
)
使用 text=True 时,Python 在 Windows 中文系统上默认以 gbk 编码读取子进程输出。当 mcporter config list 的输出中包含 UTF-8 特殊字符(如字节 0x94)时,gbk 解码失败,抛出 UnicodeDecodeError,异常被捕获后返回 False,导致 doctor 误判。
验证现象
尽管 doctor 显示 [X],实际上微信公众号渠道完全可用:
mcporter call 'exa.web_search_exa(query: "人工智能 site:mp.weixin.qq.com", numResults: 3)'
mcporter call 'exa.web_fetch_exa(urls: ["https://mp.weixin.qq.com/s/..."], maxCharacters: 5000)'
以上命令均可正常执行并返回微信公众号文章结果。
修复建议
将 text=True 替换为 encoding="utf-8", errors="replace",使其与 exa_search.py 中的做法保持一致:
r = subprocess.run(
[mcporter, "config", "list"],
capture_output=True, encoding="utf-8", errors="replace", timeout=5,
)
已在本地验证:修复后 agent-reach doctor 正常运行,微信公众号文章显示为 ✅,状态变为 9/16。
Bug 描述
在 Windows 中文系统上运行
agent-reach doctor时,微信公众号文章渠道会被错误地标记为[X] 不可用,即使mcporter和Exa MCP已经正确安装且功能完全正常。复现步骤
mcporter config add exa https://mcp.exa.ai/mcp)agent-reach doctor实际结果
UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 in position 185: illegal multibyte sequence[X] 需要 mcporter + Exa MCP 来搜索和阅读微信公众号文章agent-reach doctor状态为 8/16(实际应为 9/16)问题根因
在
agent_reach/channels/wechat.py的_exa_available()函数中:使用
text=True时,Python 在 Windows 中文系统上默认以 gbk 编码读取子进程输出。当mcporter config list的输出中包含 UTF-8 特殊字符(如字节0x94)时,gbk解码失败,抛出UnicodeDecodeError,异常被捕获后返回False,导致 doctor 误判。验证现象
尽管 doctor 显示
[X],实际上微信公众号渠道完全可用:以上命令均可正常执行并返回微信公众号文章结果。
修复建议
将
text=True替换为encoding="utf-8", errors="replace",使其与exa_search.py中的做法保持一致:已在本地验证:修复后
agent-reach doctor正常运行,微信公众号文章显示为 ✅,状态变为 9/16。