- Replace text=True with encoding='utf-8', errors='replace' in all subprocess.run calls (channels + cli.py) to fix GBK decode errors on Chinese Windows systems - Use shutil.which() resolved paths in channel subprocess calls to handle Windows .cmd wrappers (npm global installs) Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,8 @@ class ExaSearchChannel(Channel):
|
||||
return False # Search-only channel
|
||||
|
||||
def check(self, config=None):
|
||||
if not shutil.which("mcporter"):
|
||||
mcporter = shutil.which("mcporter")
|
||||
if not mcporter:
|
||||
return "off", (
|
||||
"需要 mcporter + Exa MCP。安装:\n"
|
||||
" npm install -g mcporter\n"
|
||||
@@ -24,7 +25,8 @@ class ExaSearchChannel(Channel):
|
||||
)
|
||||
try:
|
||||
r = subprocess.run(
|
||||
["mcporter", "config", "list"], capture_output=True, text=True, timeout=5
|
||||
[mcporter, "config", "list"], capture_output=True,
|
||||
encoding="utf-8", errors="replace", timeout=5
|
||||
)
|
||||
if "exa" in r.stdout.lower():
|
||||
return "ok", "全网语义搜索可用(免费,无需 API Key)"
|
||||
|
||||
Reference in New Issue
Block a user