← 返回 Skills 市场
systiger

Browser Healthcheck

作者 systiger · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
128
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install browser-healthcheck
功能描述
Automatically checks and repairs browser tool status before use to prevent timeouts, CDP disconnections, and profile conflicts during automation.
使用说明 (SKILL.md)

Browser Health Check / Browser 健康检查

Core Principle: Always check status before using the browser tool. 核心原则:每次使用 browser 工具前,先检查状态。

Quick Check Flow / 快速检查流程

1. browser(action=status, profile="openclaw")
   ├─ running=true, cdpReady=true → ✅ OK, proceed / 正常,直接使用
   ├─ running=false → Try to start / 尝试启动
   └─ Start failed → Diagnose and fix / 诊断并修复

Common Issues / 常见问题诊断

Issue 1: Profile Conflict (Most Common) / 问题 1: Profile 冲突(最常见)

Symptoms / 症状:

  • running=false, cdpReady=false
  • Timeout immediately after start / 启动后立即超时
  • Especially with profile="user" / 使用 profile="user" 时尤其容易发生

Cause / 原因:

  • User is using their own Chrome (port 9222) / 用户正在使用自己的 Chrome
  • CDP port occupied / CDP 端口被占用

Solution / 解决方案:

Use independent profile / 使用独立 profile:
browser(action=start, profile="openclaw")  # Port 9223, isolated data dir

Permanent Fix / 永久方案: Configure defaultProfile: "openclaw":

{
  "browser": {
    "enabled": true,
    "defaultProfile": "openclaw",
    "profiles": {
      "user": { "cdpPort": 9222, "attachOnly": false },
      "openclaw": { "cdpPort": 9223, "attachOnly": false }
    }
  }
}

Issue 2: Browser Process Residue / 问题 2: 浏览器进程残留

Symptoms / 症状:

  • running=false but port occupied / 端口被占用
  • Start fails with "port already in use" / 启动失败,提示端口已使用

Diagnosis / 诊断:

# Windows
netstat -ano | findstr "9223"
tasklist | findstr "chrome"

Solution / 解决方案:

# Kill residual process / 杀掉残留进程
taskkill /F /PID \x3Cpid>
# Or restart Gateway / 或重启 Gateway
openclaw gateway restart

Issue 3: CDP Port Not Responding / 问题 3: CDP 端口不响应

Symptoms / 症状:

  • running=true but cdpReady=false
  • http://127.0.0.1:9223 no response / 无响应

Solution / 解决方案:

# 1. Restart Gateway / 重启 Gateway
openclaw gateway restart

# 2. Wait 5 seconds and recheck / 等待 5 秒后重新检查
browser(action=status, profile="openclaw")

Profile Selection Guide / Profile 选择指南

Profile Port / 端口 Data Directory / 数据目录 Use Case / 适用场景
openclaw 9223 ~/.openclaw/browser/openclaw/user-data Default choice / 默认选择, isolated, no conflict
user 9222 User Chrome data dir / 用户 Chrome 目录 Need user's logged-in accounts (YouTube etc.)

⚠️ Before using user profile / 使用 user profile 前:

  1. Confirm user is not using their Chrome / 确认用户没有在使用自己的 Chrome
  2. If user is browsing, use openclaw instead / 如果用户正在使用浏览器,改用 openclaw

Health Check Script / 自动检查脚本

Run scripts/healthcheck.py for full diagnosis:

python scripts/healthcheck.py --profile openclaw

Output Example / 输出示例:

[OK] Browser enabled: true
[OK] Default profile: openclaw
[OK] CDP port 9223 available
[OK] Browser running: true
[OK] CDP ready: true
[PASS] Browser health check passed

Best Practices / 最佳实践

Pre-use Check (Recommended) / 使用前检查(推荐)

# 1. Check status / 检查状态
status = browser(action=status, profile="openclaw")

# 2. Start if not running / 如果未运行,启动
if not status["running"]:
    browser(action=start, profile="openclaw")

# 3. Execute operation / 执行操作
browser(action=snapshot, profile="openclaw")

Post-failure Repair / 失败后修复

try:
    browser(action=snapshot, profile="openclaw")
except TimeoutError:
    # 1. Check status / 检查状态
    status = browser(action=status, profile="openclaw")
    
    # 2. Diagnose based on status / 根据状态诊断
    if not status["running"]:
        browser(action=start, profile="openclaw")
    elif not status["cdpReady"]:
        exec("openclaw gateway restart")
        time.sleep(5)
        browser(action=start, profile="openclaw")

Technical Details / 技术细节

OpenClaw Browser Architecture / OpenClaw Browser 架构

Gateway (port 18789)
    └── Browser Plugin
            ├── openclaw profile (port 9223)
            │   └── user-data: ~/.openclaw/browser/openclaw/
            └── user profile (port 9222)
                └── user-data: User Chrome directory

CDP Protocol / CDP 协议

Chrome DevTools Protocol (CDP) for remote debugging:

  • Default ports: 9222 (user) / 9223 (openclaw)
  • HTTP endpoint: http://127.0.0.1:9223/json
  • WebSocket: ws://127.0.0.1:9223/devtools/...

Remember: Check first, use later. When timeout occurs, switch profile first. 记住:先检查,后使用。遇到超时,先切换 profile。

安全使用建议
This skill appears to do what it says: local diagnostics of the OpenClaw browser/CDP setup. Before installing or running with automatic fixes enabled, consider: (1) The script reads ~/.openclaw/openclaw.json — review that file if you care about what configuration is inspected. (2) If you run the script with --fix or follow SKILL.md repair steps, it may run system commands that kill processes (taskkill) or restart the OpenClaw gateway — these are destructive to local processes and require appropriate privileges. (3) Some repair commands in SKILL.md are Windows-specific (netstat -ano, taskkill) and the find/kill logic may not work on Linux/macOS as-is. (4) The SKILL.md contains a small coding mistake (using exec("openclaw gateway restart") in a Python snippet) — the intent is to run the shell command, but that snippet will not work as shown. Recommendation: run the health check in non-fix/diagnostic mode first to see reported issues, inspect the detected PID/process before allowing automated kills, and ensure the skill is only used on machines where you trust restarting/killing processes is acceptable.
功能分析
Type: OpenClaw Skill Name: browser-healthcheck Version: 1.0.0 The skill bundle is a legitimate utility designed for diagnosing and repairing connection issues with the OpenClaw browser tool. It contains a Python script (scripts/healthcheck.py) that checks local CDP ports (9222/9223) and manages conflicting processes using standard Windows commands (netstat, taskkill), and the SKILL.md provides clear instructions for the AI agent to automate these troubleshooting steps. No evidence of data exfiltration, unauthorized remote execution, or malicious intent was found.
能力评估
Purpose & Capability
The name/description (browser health check / auto-repair) align with the included script and SKILL.md. The script inspects a local OpenClaw config (~/.openclaw/openclaw.json), probes localhost CDP ports, and offers to start/kill/restart services — all coherent with diagnosing browser/CDP issues.
Instruction Scope
Instructions stay focused on browser health: checking status, querying http://127.0.0.1:<port>/json endpoints, and restarting or killing local processes. Two items to note: (1) the SKILL.md example uses exec("openclaw gateway restart") inside Python, which is a coding error (exec executes Python, not shell) — this is a bug, not exfiltration; (2) the post-fix actions include running system commands (taskkill, openclaw gateway restart) which are expected for repair but are privileged actions the user should expect before enabling automatic fixes.
Install Mechanism
There is no install spec (instruction-only plus a single Python script). Nothing is downloaded or written by an installer during skill install.
Credentials
The skill requests no environment variables, no external credentials, and only reads a local configuration file (~/.openclaw/openclaw.json). That local config access is reasonable for a tool that needs to inspect OpenClaw browser settings.
Persistence & Privilege
The skill is not always-enabled and uses the platform defaults for invocation. The only privileged actions are local repair steps (taskkill, restarting gateway) which are gated behind the --fix flag or explicit repair instructions — appropriate for this purpose.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install browser-healthcheck
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /browser-healthcheck 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of browser-healthcheck: - Automatically checks browser status before each use. - Diagnoses and attempts auto-repair on common browser issues such as profile conflicts, process residue, and CDP connection problems. - Provides a step-by-step troubleshooting guide for resolving browser timeouts and disconnections. - Includes best practices and sample scripts for pre-use checks and post-failure repairs. - Offers a clear profile selection guide and technical architecture overview.
元数据
Slug browser-healthcheck
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Browser Healthcheck 是什么?

Automatically checks and repairs browser tool status before use to prevent timeouts, CDP disconnections, and profile conflicts during automation. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 128 次。

如何安装 Browser Healthcheck?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install browser-healthcheck」即可一键安装,无需额外配置。

Browser Healthcheck 是免费的吗?

是的,Browser Healthcheck 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Browser Healthcheck 支持哪些平台?

Browser Healthcheck 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Browser Healthcheck?

由 systiger(@systiger)开发并维护,当前版本 v1.0.0。

💬 留言讨论