fix: doctor status must be honest — show real capability per channel

Before: everything under tier 0 showed  with vague descriptions
After: each channel shows its actual capability and limitations

Changes:
- GitHub: 'Public repos only. Set github_token for private repos'
- Twitter: shows 'Full access' vs 'Read-only' depending on birdx
- Bilibili: ⚠️ warning on servers about potential IP blocks
- XiaoHongShu: friendly message when no cookie (was showing Jina 451)
- Doctor format: tier 0 items now show detailed status messages, not just 
- README: platform table updated to match reality (removed exaggerated claims)
- README: doctor example updated to show new honest format
This commit is contained in:
Panniantong
2026-02-24 09:00:34 +01:00
parent 07c6efbc7e
commit 904f8dfb49
6 changed files with 54 additions and 15 deletions
+17
View File
@@ -20,6 +20,23 @@ class BilibiliChannel(Channel):
domain = urlparse(url).netloc.lower()
return "bilibili.com" in domain or "b23.tv" in domain
def check(self, config=None):
proxy = config.get("bilibili_proxy") if config else None
if proxy:
return "ok", "Via proxy"
# Detect if we're on a server (same logic as cli._detect_environment)
import os
indicators = [
os.path.exists("/var/run/docker.sock"),
os.path.exists("/etc/cloud"),
"SSH_CONNECTION" in os.environ,
"container" in os.environ.get("container", ""),
]
is_server = any(indicators)
if is_server:
return "warn", "May be blocked on servers. Fix: agent-eyes configure proxy URL"
return "ok", "Local access"
async def read(self, url: str, config=None) -> ReadResult:
# Proxy support (Bilibili blocks server IPs)
proxy = config.get("bilibili_proxy") if config else None
+7 -1
View File
@@ -13,7 +13,7 @@ from typing import List
class GitHubChannel(Channel):
name = "github"
description = "GitHub repos, issues, PRs, code"
description = "GitHub repos and code"
backends = ["GitHub API"]
tier = 0
@@ -26,6 +26,12 @@ class GitHubChannel(Channel):
h["Authorization"] = f"Bearer {token}"
return h
def check(self, config=None):
token = config.get("github_token") if config else None
if token:
return "ok", "Full access (authenticated)"
return "ok", "Public repos only. Set github_token for private repos + higher rate limits"
def can_handle(self, url: str) -> bool:
domain = urlparse(url).netloc.lower()
return "github.com" in domain
+3 -2
View File
@@ -16,7 +16,7 @@ import requests
class TwitterChannel(Channel):
name = "twitter"
description = "Twitter/X posts, search, timelines"
description = "Twitter/X posts"
backends = ["birdx", "Jina Reader"]
tier = 0 # Single tweet reading is zero-config
@@ -27,7 +27,8 @@ class TwitterChannel(Channel):
def check(self, config=None):
# Basic reading always works (Jina fallback)
if shutil.which("birdx"):
return "ok", "birdx (full: search + timeline + threads)"
return "ok", "Full access (search + timeline + threads)"
return "ok", "Read-only (single tweets via Jina). Install birdx for search + timelines"
return "ok", "Jina Reader (single tweets only)"
async def read(self, url: str, config=None) -> ReadResult:
+7 -5
View File
@@ -37,11 +37,13 @@ def format_report(results: Dict[str, dict]) -> str:
lines.append("")
lines.append("✅ Ready (no setup needed):")
for key, r in results.items():
if r["tier"] == 0 and r["status"] == "ok":
backends = ", ".join(r["backends"]) if r["backends"] else "built-in"
lines.append(f"{r['name']} [{backends}]")
elif r["tier"] == 0 and r["status"] in ("warn", "off"):
lines.append(f" ⚠️ {r['name']}{r['message']}")
if r["tier"] == 0:
if r["status"] == "ok":
lines.append(f"{r['name']} {r['message']}")
elif r["status"] == "warn":
lines.append(f" ⚠️ {r['name']}{r['message']}")
elif r["status"] in ("off", "error"):
lines.append(f"{r['name']}{r['message']}")
# Tier 1 — needs free key
tier1 = {k: r for k, r in results.items() if r["tier"] == 1}