{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openclaw-gateway-fd-fix",
    "name": "Openclaw Gateway Fd Fix",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/thomaszhang2661/openclaw-gateway-fd-fix",
    "canonicalUrl": "https://clawhub.ai/thomaszhang2661/openclaw-gateway-fd-fix",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/openclaw-gateway-fd-fix",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-gateway-fd-fix",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "fix.sh"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openclaw-gateway-fd-fix"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/openclaw-gateway-fd-fix",
    "agentPageUrl": "https://openagent3.xyz/skills/openclaw-gateway-fd-fix/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-gateway-fd-fix/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-gateway-fd-fix/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Problem",
        "body": "OpenClaw Gateway crashes or hangs with these errors:\n\nspawn EBADF when running exec commands\nRPC probe failed / gateway timeout\nLogs show EMFILE: too many open files, watch\nGateway process is running but unresponsive"
      },
      {
        "title": "Root Cause",
        "body": "The Gateway automatically watches all files under ~/.openclaw/workspace/ for changes. If you place virtual environments (.venv), node_modules, large datasets, or tens of thousands of small files inside workspace, the file watcher will exceed macOS's default file descriptor limit (256), causing the process to hang."
      },
      {
        "title": "Auto-Fix (Recommended)",
        "body": "Run the one-click repair script:\n\nbash fix.sh\n\nWhat it does:\n\nDetects workspace file count\nFinds and removes unnecessary dependency directories (.venv, node_modules) inside workspace\nBacks up your existing LaunchAgent plist\nUpdates LaunchAgent to set file descriptor limit to 524,288\nRestarts the Gateway service\nVerifies service health"
      },
      {
        "title": "Manual Fix Steps",
        "body": "If you prefer to fix manually:\n\nRemove large directories from workspace:\n# Never put these inside ~/.openclaw/workspace/:\nrm -rf ~/.openclaw/workspace/*/.venv\nrm -rf ~/.openclaw/workspace/*/node_modules\n# Move datasets/models/venvs to ~/Downloads/ or /tmp/\n\n\nUpdate LaunchAgent resource limits:\nEdit ~/Library/LaunchAgents/ai.openclaw.gateway.plist and add inside the root <dict>:\n<key>HardResourceLimits</key>\n<dict>\n  <key>NumberOfFiles</key>\n  <integer>524288</integer>\n</dict>\n<key>SoftResourceLimits</key>\n<dict>\n  <key>NumberOfFiles</key>\n  <integer>524288</integer>\n</dict>\n\n\nRestart Gateway:\nlaunchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist\nlaunchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist\nsleep 10 && openclaw gateway status"
      },
      {
        "title": "Permanent Rule (NEVER BREAK)",
        "body": "✅ Do NOT put these inside ~/.openclaw/workspace/:\n\nPython virtual environments (.venv, venv)\nNode.js node_modules directories\nLarge datasets (>1000 files)\nAI model weights (.pt, .bin, .pth files)\nCache directories with thousands of small files\n\n✅ Put these outside workspace: /tmp/, ~/Downloads/, or any directory outside ~/.openclaw/workspace/"
      },
      {
        "title": "Verification",
        "body": "After fix, run:\n\nopenclaw gateway status\n\nYou should see RPC probe: ok in the output."
      },
      {
        "title": "Troubleshooting",
        "body": "If fix fails:\n\nCheck logs: tail -50 ~/.openclaw/logs/gateway.err.log\nVerify no large directories remain in workspace: find ~/.openclaw/workspace -type f | wc -l (should be < 1000)\nManually restart Gateway: openclaw gateway stop && openclaw gateway install"
      }
    ],
    "body": "OpenClaw Gateway File Descriptor Exhaustion Fix\nProblem\n\nOpenClaw Gateway crashes or hangs with these errors:\n\nspawn EBADF when running exec commands\nRPC probe failed / gateway timeout\nLogs show EMFILE: too many open files, watch\nGateway process is running but unresponsive\nRoot Cause\n\nThe Gateway automatically watches all files under ~/.openclaw/workspace/ for changes. If you place virtual environments (.venv), node_modules, large datasets, or tens of thousands of small files inside workspace, the file watcher will exceed macOS's default file descriptor limit (256), causing the process to hang.\n\nUsage\nAuto-Fix (Recommended)\n\nRun the one-click repair script:\n\nbash fix.sh\n\n\nWhat it does:\n\nDetects workspace file count\nFinds and removes unnecessary dependency directories (.venv, node_modules) inside workspace\nBacks up your existing LaunchAgent plist\nUpdates LaunchAgent to set file descriptor limit to 524,288\nRestarts the Gateway service\nVerifies service health\nManual Fix Steps\n\nIf you prefer to fix manually:\n\nRemove large directories from workspace:\n# Never put these inside ~/.openclaw/workspace/:\nrm -rf ~/.openclaw/workspace/*/.venv\nrm -rf ~/.openclaw/workspace/*/node_modules\n# Move datasets/models/venvs to ~/Downloads/ or /tmp/\n\nUpdate LaunchAgent resource limits: Edit ~/Library/LaunchAgents/ai.openclaw.gateway.plist and add inside the root <dict>:\n<key>HardResourceLimits</key>\n<dict>\n  <key>NumberOfFiles</key>\n  <integer>524288</integer>\n</dict>\n<key>SoftResourceLimits</key>\n<dict>\n  <key>NumberOfFiles</key>\n  <integer>524288</integer>\n</dict>\n\nRestart Gateway:\nlaunchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist\nlaunchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist\nsleep 10 && openclaw gateway status\n\nPermanent Rule (NEVER BREAK)\n\n✅ Do NOT put these inside ~/.openclaw/workspace/:\n\nPython virtual environments (.venv, venv)\nNode.js node_modules directories\nLarge datasets (>1000 files)\nAI model weights (.pt, .bin, .pth files)\nCache directories with thousands of small files\n\n✅ Put these outside workspace: /tmp/, ~/Downloads/, or any directory outside ~/.openclaw/workspace/\n\nVerification\n\nAfter fix, run:\n\nopenclaw gateway status\n\n\nYou should see RPC probe: ok in the output.\n\nTroubleshooting\n\nIf fix fails:\n\nCheck logs: tail -50 ~/.openclaw/logs/gateway.err.log\nVerify no large directories remain in workspace: find ~/.openclaw/workspace -type f | wc -l (should be < 1000)\nManually restart Gateway: openclaw gateway stop && openclaw gateway install"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/thomaszhang2661/openclaw-gateway-fd-fix",
    "publisherUrl": "https://clawhub.ai/thomaszhang2661/openclaw-gateway-fd-fix",
    "owner": "thomaszhang2661",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openclaw-gateway-fd-fix",
    "downloadUrl": "https://openagent3.xyz/downloads/openclaw-gateway-fd-fix",
    "agentUrl": "https://openagent3.xyz/skills/openclaw-gateway-fd-fix/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-gateway-fd-fix/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-gateway-fd-fix/agent.md"
  }
}