[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71AGES2KCCARFZW37S6X4AT":3,"skill-same:01M71AGES2KCCARFZW37S6X4AT":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":14,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M71AGES2KCCARFZW37S6X4AT","fix-gateway-status-import-error",null,"Diagnose and fix missing import errors in gateway\u002Fstatus.py, particularly 'acquire_scoped_lock' and other missing functions","sapsapshen\u002Fai-memory-router","sapsapshen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F20347959?v=4","01M6XDQEF1DP50DKF37H81J3J5","shenmian","01M6XDQEJPE41Y3DT2763X8ZJN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fhermes\u002Ffix-gateway-status-import-error\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"fix gateway status import error","gateway","fix","status","error","import","name","import-error","when","scoped","lock","errors","missing","compatibility","functions","acquire","hermes","diagnose","windows","2026-11-10 10:12:30",false,"---\nname: fix-gateway-status-import-error\ntitle: Fix Hermes Gateway status.py ImportError\ndescription: Diagnose and fix missing import errors in gateway\u002Fstatus.py, particularly 'acquire_scoped_lock' and other missing functions\ntrigger: When encountering ImportError from gateway.status (e.g., \"cannot import name 'acquire_scoped_lock' from 'gateway.status'\")\ntags: [hermes, gateway, windows, compatibility, import-error]\n---\n\n# Fixing Hermes Gateway status.py ImportError\n\n## Problem\nHermes Gateway fails to start with error:\n```\nImportError: cannot import name 'acquire_scoped_lock' from 'gateway.status'\n```\n\nThis typically happens when the `gateway\u002Fstatus.py` file has been replaced with a Windows-compatible version that lacks functions required by platform adapters (feishu.py, discord.py, telegram.py, etc.).\n\n## Root Cause\nThe Windows-compatible `status.py` contains only basic PID management functions but misses:\n- `acquire_scoped_lock` and `release_scoped_lock` - used by all platform adapters for token locking\n- `write_runtime_status` and `read_runtime_status` - used for gateway health tracking\n- `is_gateway_running` - used by CLI tools\n\n## Solution: Create Hybrid status.py\n\nCreate a hybrid version that maintains Windows compatibility while restoring all required functions.\n\n### Step 1: Examine the Current File\n```bash\nread_file \u002Fpath\u002Fto\u002Fhermes-agent\u002Fgateway\u002Fstatus.py\n```\n\nCheck what functions are present. The Windows version typically only has:\n- `get_running_pid()`\n- `write_pid_file()`\n- `remove_pid_file()`\n- `release_all_scoped_locks()`\n\n### Step 2: Check Backup File\n```bash\nread_file \u002Fpath\u002Fto\u002Fhermes-agent\u002Fgateway\u002Fstatus.py.backup\n```\n\nThe backup contains the original implementation with all required functions.\n\n### Step 3: Check What's Imported\nSearch for all imports of `gateway.status` to understand the full scope:\n```bash\nsearch_files \"from gateway.status import\" \u002Fpath\u002Fto\u002Fhermes-agent\n```\n\nThis reveals all required functions.\n\n### Step 4: Create Hybrid Implementation\n\nThe hybrid `status.py` should:\n\n1. **Keep Windows PID checking logic**: On Windows, check process existence via file modification time\n2. **Add Unix process checking**: On Unix, use `\u002Fproc` filesystem and `os.kill()`\n3. **Make lock functions platform-aware**: Handle `\u002Fproc` access gracefully on Windows\n4. **Include all required functions**: See complete list below\n\n### Complete Function List Required\n\nThe final `status.py` must include:\n- `get_running_pid()` - with platform-specific logic\n- `write_pid_file(pid)`\n- `remove_pid_file()`\n- `acquire_scoped_lock(scope, identity, metadata)`\n- `release_scoped_lock(scope, identity)`\n- `release_all_scoped_locks()`\n- `write_runtime_status()` - with gateway_state, platform, etc. parameters\n- `read_runtime_status()`\n- `is_gateway_running()`\n\n### Key Implementation Details\n\n#### Platform Detection\n```python\nimport sys\nif sys.platform == \"win32\":\n    # Windows-specific logic\nelse:\n    # Unix-specific logic\n```\n\n#### Windows Process Checking\nOn Windows, cannot use `\u002Fproc` or `os.kill()` reliably. Instead:\n- Check PID file modification time (if \u003C 5 minutes, assume running)\n- Return `None` for process start time queries\n\n#### Lock File Paths\n```python\ndef _get_lock_dir() -> Path:\n    if sys.platform == \"win32\":\n        # Use HERMES_HOME\u002Fgateway\u002Flocks on Windows\n        hermes_home = Path(os.environ.get('HERMES_HOME', Path.home() \u002F '.hermes'))\n        return hermes_home \u002F 'gateway' \u002F 'locks'\n    else:\n        # Use XDG_STATE_HOME on Unix\n        state_home = Path(os.getenv(\"XDG_STATE_HOME\", Path.home() \u002F \".local\" \u002F \"state\"))\n        return state_home \u002F \"hermes\" \u002F \"gateway-locks\"\n```\n\n### Step 5: Test the Fix\n\nCreate test script:\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport sys\nsys.path.insert(0, '\u002Fpath\u002Fto\u002Fhermes-agent')\n\nfrom gateway.status import (\n    get_running_pid,\n    write_pid_file,\n    remove_pid_file,\n    acquire_scoped_lock,\n    release_scoped_lock,\n    release_all_scoped_locks,\n    write_runtime_status,\n    read_runtime_status,\n    is_gateway_running\n)\n\nprint(\"All imports successful!\")\n\n# Test lock functions\nacquired, existing = acquire_scoped_lock(\"test\", \"test-identity\", {\"test\": True})\nif acquired:\n    release_scoped_lock(\"test\", \"test-identity\")\n```\n\n### Step 6: Verify Gateway Starts\n```bash\ncd \u002Fpath\u002Fto\u002Fhermes-agent\npython hermes gateway\n```\n\nShould start without ImportError (may show platform configuration warnings).\n\n## Common Pitfalls\n\n1. **Missing hermes_constants**: If `get_hermes_home()` is missing, check `hermes_constants.py` exists\n2. **Virtual environment**: Ensure you're in the correct Python environment with all dependencies\n3. **Unicode characters**: Windows may have issues with special characters in code - replace ✓\u002F✗ with [OK]\u002F[FAIL]\n4. **File permissions**: Ensure status.py is writable\n\n## Verification\n\nGateway should start with messages like:\n```\nWARNING gateway.run: Feishu: lark-oapi not installed...\n┌─────────────────────────────────────────────────────────┐\n│           ⚕ Hermes Gateway Starting...                 │\n└─────────────────────────────────────────────────────────┘\n```\n\n**No ImportError about `acquire_scoped_lock` or other missing functions.**\n\n## Related Skills\n- `hermes-windows-compatibility-fix` - General Windows compatibility fixes\n- `hermes-windows-setup-and-provider-config` - Windows setup and configuration","# Fixing Hermes Gateway status.py ImportError\n\n## Problem\nHermes Gateway fails to start with error:\n```\nImportError: cannot import name 'acquire_scoped_lock' from 'gateway.status'\n```\n\nThis typically happens when the `gateway\u002Fstatus.py` file has been replaced with a Windows-compatible version that lacks functions required by platform adapters (feishu.py, discord.py, telegram.py, etc.).\n\n## Root Cause\nThe Windows-compatible `status.py` contains only basic PID management functions but misses:\n- `acquire_scoped_lock` and `release_scoped_lock` - used by all platform adapters for token locking\n- `write_runtime_status` and `read_runtime_status` - used for gateway health tracking\n- `is_gateway_running` - used by CLI tools\n\n## Solution: Create Hybrid status.py\n\nCreate a hybrid version that maintains Windows compatibility while restoring all required functions.\n\n### Step 1: Examine the Current File\n```bash\nread_file \u002Fpath\u002Fto\u002Fhermes-agent\u002Fgateway\u002Fstatus.py\n```\n\nCheck what functions are present. The Windows version typically only has:\n- `get_running_pid()`\n- `write_pid_file()`\n- `remove_pid_file()`\n- `release_all_scoped_locks()`\n\n### Step 2: Check Backup File\n```bash\nread_file \u002Fpath\u002Fto\u002Fhermes-agent\u002Fgateway\u002Fstatus.py.backup\n```\n\nThe backup contains the original implementation with all required functions.\n\n### Step 3: Check What's Imported\nSearch for all imports of `gateway.status` to understand the full scope:\n```bash\nsearch_files \"from gateway.status import\" \u002Fpath\u002Fto\u002Fhermes-agent\n```\n\nThis reveals all required functions.\n\n### Step 4: Create Hybrid Implementation\n\nThe hybrid `status.py` should:\n\n1. **Keep Windows PID checking logic**: On Windows, check process existence via file modification time\n2. **Add Unix process checking**: On Unix, use `\u002Fproc` filesystem and `os.kill()`\n3. **Make lock functions platform-aware**: Handle `\u002Fproc` access gracefully on Windows\n4. **Include all required functions**: See complete list below\n\n### Complete Function List Required\n\nThe final `status.py` must include:\n- `get_running_pid()` - with platform-specific logic\n- `write_pid_file(pid)`\n- `remove_pid_file()`\n- `acquire_scoped_lock(scope, identity, metadata)`\n- `release_scoped_lock(scope, identity)`\n- `release_all_scoped_locks()`\n- `write_runtime_status()` - with gateway_state, platform, etc. parameters\n- `read_runtime_status()`\n- `is_gateway_running()`\n\n### Key Implementation Details\n\n#### Platform Detection\n```python\nimport sys\nif sys.platform == \"win32\":\n    # Windows-specific logic\nelse:\n    # Unix-specific logic\n```\n\n#### Windows Process Checking\nOn Windows, cannot use `\u002Fproc` or `os.kill()` reliably. Instead:\n- Check PID file modification time (if \u003C 5 minutes, assume running)\n- Return `None` for process start time queries\n\n#### Lock File Paths\n```python\ndef _get_lock_dir() -> Path:\n    if sys.platform == \"win32\":\n        # Use HERMES_HOME\u002Fgateway\u002Flocks on Windows\n        hermes_home = Path(os.environ.get('HERMES_HOME', Path.home() \u002F '.hermes'))\n        return hermes_home \u002F 'gateway' \u002F 'locks'\n    else:\n        # Use XDG_STATE_HOME on Unix\n        state_home = Path(os.getenv(\"XDG_STATE_HOME\", Path.home() \u002F \".local\" \u002F \"state\"))\n        return state_home \u002F \"hermes\" \u002F \"gateway-locks\"\n```\n\n### Step 5: Test the Fix\n\nCreate test script:\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport sys\nsys.path.insert(0, '\u002Fpath\u002Fto\u002Fhermes-agent')\n\nfrom gateway.status import (\n    get_running_pid,\n    write_pid_file,\n    remove_pid_file,\n    acquire_scoped_lock,\n    release_scoped_lock,\n    release_all_scoped_locks,\n    write_runtime_status,\n    read_runtime_status,\n    is_gateway_running\n)\n\nprint(\"All imports successful!\")\n\n# Test lock functions\nacquired, existing = acquire_scoped_lock(\"test\", \"test-identity\", {\"test\": True})\nif acquired:\n    release_scoped_lock(\"test\", \"test-identity\")\n```\n\n### Step 6: Verify Gateway Starts\n```bash\ncd \u002Fpath\u002Fto\u002Fhermes-agent\npython hermes gateway\n```\n\nShould start without ImportError (may show platform configuration warnings).\n\n## Common Pitfalls\n\n1. **Missing hermes_constants**: If `get_hermes_home()` is missing, check `hermes_constants.py` exists\n2. **Virtual environment**: Ensure you're in the correct Python environment with all dependencies\n3. **Unicode characters**: Windows may have issues with special characters in code - replace ✓\u002F✗ with [OK]\u002F[FAIL]\n4. **File permissions**: Ensure status.py is writable\n\n## Verification\n\nGateway should start with messages like:\n```\nWARNING gateway.run: Feishu: lark-oapi not installed...\n┌─────────────────────────────────────────────────────────┐\n│           ⚕ Hermes Gateway Starting...                 │\n└─────────────────────────────────────────────────────────┘\n```\n\n**No ImportError about `acquire_scoped_lock` or other missing functions.**\n\n## Related Skills\n- `hermes-windows-compatibility-fix` - General Windows compatibility fixes\n- `hermes-windows-setup-and-provider-config` - Windows setup and configuration",{"name":5,"tags":43,"title":44,"trigger":45,"description":7},[35,20,37,32,26],"Fix Hermes Gateway status.py ImportError","When encountering ImportError from gateway.status (e.g., \"cannot import name 'acquire_scoped_lock' from 'gateway.status'\")","main","7a38d8e7073e61c16eda85681cb32fb68a8657a5","skills-store\u002Fhermes\u002Ffix-gateway-status-import-error","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router","https:\u002F\u002Fgithub.com\u002Fsapsapshen","2026-04-14 21:12:12",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add sapsapshen\u002Fai-memory-router --skill fix-gateway-status-import-error",{"tool":58,"command":59},"bunx","bunx skills add sapsapshen\u002Fai-memory-router --skill fix-gateway-status-import-error",{"tool":61,"command":62},"pnpm","pnpm dlx skills add sapsapshen\u002Fai-memory-router --skill fix-gateway-status-import-error","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fhermes\u002Ffix-gateway-status-import-error\u002FSKILL.md",true,[],[67,91,116,126,139,158],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":78,"publishedAt":38},"01M71ATQRKG48SH06FQ697T5G9","wechat-search","Search WeChat Official Account articles using OpenClaw's web search and fetch capabilities with compliance-focused design.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fwechat-search-release\u002FSKILL.md",[73],{"categoryNo":74,"categoryName":75,"taxonomyType":76,"taxonomyTypeDesc":77},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[79,80,81,82,83,84,85,86,87,88,89,90],"wechat search","wechat","search","capabilities","openclaw","design","web search","compliance","web","official","fetch","with",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":38},"01M71ATNAVGZB35PFYM2GC5N00","trend-tap","Real-time trending topics aggregator across 7 platforms (X\u002FTwitter, Reddit, Google Trends, Hacker News, Zhihu, Bilibili, Weibo). Trigger: when user says 'trend', 'trends', 'trend tap', '热点', '热搜', or asks what is trending\u002Fhot. Do NOT use web_search — this skill already fetches live data from all platforms with zero API keys.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftrend-tap\u002FSKILL.md",[],[98,99,100,101,102,103,81,104,105,106,107,27,108,109,110,111,112,113,114,115],"trend","trend tap","tap","api keys","Bash","time","trending","hacker","aggregator","do","brew","live","data","google","install","read","across","api",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":38},"01M71ATJ9AM5KM15AA8PS302EB","trend-radar","Real-time trending topics aggregator across 7 platforms (X\u002FTwitter, Reddit, Google Trends, Hacker News, Zhihu, Bilibili, Weibo). Trigger: when user says 'trend', 'trends', 'trend pulse', '热点', '热搜', or asks what is trending\u002Fhot. Do NOT use web_search — this skill already fetches live data from all platforms with zero API keys.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftrend-radar\u002FSKILL.md",[],[123,124,98,108,109,110,111,102,81,113,125,114,115,27,106,105,104,112,103,101],"trend radar","radar","pulse",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":38},"01M71ATGF095N3EJM9G8SD0BB5","tech-news-daily","每日科技新闻汇——从全球多个 RSS 源抓取最新科技新闻，翻译（英→中）、去重、排版成每日简报。当用户询问科技新闻、科技新鲜事、每日科技、技术动态、Daily Tech News 或类似表达时触发此技能。","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftech-news-daily\u002FSKILL.md",[],[133,134,135,136,137,138],"news","tech","tech news daily","daily","rss","翻译",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":150,"publishedAt":38},"01M71ATFAEAMQ17M70NQNY7SR8","summarize","Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fsummarize\u002FSKILL.md",[145],{"categoryNo":146,"categoryName":147,"taxonomyType":148,"taxonomyTypeDesc":149},"01JBSEEDCAT000000000000021","资料检索与研究","SCENARIO","使用场景",[141,87,151,152,153,90,108,154,155,156,100,157,112],"Audio","cli","youtube","images","https","files","pdfs",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":38},"01M71ATDNS3R0M4H936PACQAWZ","sonoscli","Control Sonos speakers (discover\u002Fstatus\u002Fplay\u002Fvolume\u002Fgroup).","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fsonoscli\u002FSKILL.md",[],[160,22,165,166,112,167,155,168,169,170,171,172],"play","go","latest","github","discover","control","cmd","volume"]