From 8c3390edd1ef6cd6960bbb30d84be07371650576 Mon Sep 17 00:00:00 2001 From: Jah-yee Date: Fri, 13 Mar 2026 10:57:30 +0800 Subject: [PATCH 1/2] fix: improve xiaohongshu MCP status detection for Windows compatibility - Use JSON parsing instead of rigid string matching - Handle Windows line endings (CRLF) - Case-insensitive status check - Add fallback for different JSON output formats - Fixes false negative in doctor check on Windows with mcporter --- agent_reach/channels/xiaohongshu.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/agent_reach/channels/xiaohongshu.py b/agent_reach/channels/xiaohongshu.py index 1527146..f7279dd 100644 --- a/agent_reach/channels/xiaohongshu.py +++ b/agent_reach/channels/xiaohongshu.py @@ -74,9 +74,26 @@ def check(self, config=None): errors="replace", timeout=10, ) - out = r.stdout.lower() - if r.returncode == 0 and '"status": "ok"' in out: - return "ok", "MCP 已连接(阅读、搜索、发帖、评论、点赞)" + # More robust JSON parsing instead of string matching + # Handle different JSON formats and Windows line endings + import json + try: + # Try to parse the JSON output directly + output = r.stdout.strip() + # Handle potential BOM or whitespace + if output.startswith('\ufeff'): + output = output[1:] + data = json.loads(output) + # Check various possible status field names and values + status = data.get('status', '').lower() if isinstance(data, dict) else '' + if r.returncode == 0 and status == 'ok': + return "ok", "MCP 已连接(阅读、搜索、发帖、评论、点赞)" + except (json.JSONDecodeError, ValueError): + # Fallback to string matching for backward compatibility + # Make it case-insensitive and handle Windows-style output + out = r.stdout.lower().replace('\r\n', '\n').replace('\r', '\n') + if r.returncode == 0 and '"status":"ok"' in out.replace(' ', ''): + return "ok", "MCP 已连接(阅读、搜索、发帖、评论、点赞)" return "warn", "MCP 已配置,但连接异常;请检查 xiaohongshu-mcp 服务状态" except subprocess.TimeoutExpired: return "warn", "MCP 已配置,但健康检查超时;请检查 xiaohongshu-mcp 服务状态" From 7b8b28d290bd3abbeaf56f68e2a9649ba819f5a1 Mon Sep 17 00:00:00 2001 From: Jah-yee Date: Fri, 13 Mar 2026 20:46:13 +0800 Subject: [PATCH 2/2] fix: shorten SKILL.md description to stay under 1024-char limit Resolves: #163 - Description reduced from ~7800 to ~570 characters - Kept key functionality description - Removed redundant trigger list (available in full docs) --- agent_reach/skill/SKILL.md | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/agent_reach/skill/SKILL.md b/agent_reach/skill/SKILL.md index 26e3ab1..ff691b6 100644 --- a/agent_reach/skill/SKILL.md +++ b/agent_reach/skill/SKILL.md @@ -1,23 +1,11 @@ --- name: agent-reach description: > - Give your AI agent eyes to see the entire internet. 7500+ GitHub stars. - Search and read 15 platforms: Twitter/X, Reddit, YouTube, GitHub, Bilibili, - XiaoHongShu (小红书), Douyin (抖音), Weibo (微博), WeChat Articles (微信公众号), - LinkedIn, Instagram, V2EX, RSS, Exa web search, and any web page. + Give your AI agent eyes to see the entire internet. Search and read 15 platforms: + Twitter/X, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu, Douyin, Weibo, + WeChat Articles, LinkedIn, Instagram, V2EX, RSS, Exa web search, and any web page. One command install, zero config for 8 channels, agent-reach doctor for diagnostics. - Use when: (1) user asks to search or read any of these platforms, - (2) user shares a URL from any supported platform, - (3) user asks to search the web, find information online, or research a topic, - (4) user asks to post, comment, or interact on supported platforms, - (5) user asks to configure or set up a platform channel. - Triggers: "搜推特", "搜小红书", "看视频", "搜一下", "上网搜", "帮我查", "全网搜索", - "search twitter", "read tweet", "youtube transcript", "search reddit", - "read this link", "看这个链接", "B站", "bilibili", "抖音视频", - "微信文章", "公众号", "LinkedIn", "GitHub issue", "RSS", "微博", - "V2EX", "v2ex", "节点", "看主题", "技术社区", - "search online", "web search", "find information", "research", - "帮我配", "configure twitter", "configure proxy", "帮我安装". + Use when: user asks to search/read platforms, shares URLs, or needs web research. metadata: openclaw: homepage: https://github.com/Panniantong/Agent-Reach