← 返回 Skills 市场
Feishu Cache Guardian
作者
zhs0430-sudo
· GitHub ↗
· v1.0.0
381
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install feishu-cache-guardian
功能描述
飞书缓存配置守护工具。用于检查和修复 OpenClaw 飞书插件的 probe.ts 缓存配置。当飞书 API 健康检查的缓存时间被重置为默认值时,自动修复为60分钟缓存,避免API配额被快速耗尽。使用场景:OpenClaw升级后、飞书插件被覆盖后、定期检查缓存配置是否正常。
使用说明 (SKILL.md)
Feishu Cache Guardian - 飞书缓存守护
背景
OpenClaw 的飞书通道每分钟会执行一次健康检查,调用 probeFeishu() 函数获取机器人信息。如果没有缓存机制,每月会产生约 43,200 次 API 调用,远超飞书免费配额的 10,000 次/月。
郑工长的优化方案添加了缓存机制:
- 成功响应缓存 60 分钟
- 失败响应缓存 60 分钟
问题:每次 OpenClaw 升级都会覆盖 probe.ts 文件,导致优化失效。
功能
本技能提供自动检查和修复功能:
- 检查
probe.ts的缓存配置是否为 60 分钟 - 如果被重置为默认值,自动修复
- 修复后自动重启 Gateway 使配置生效
使用方法
手动检查/修复
node ~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js
设置定时检查(推荐)
使用 OpenClaw 的 cron 功能,每天检查一次:
openclaw cron add \
--name "feishu-cache-check" \
--schedule "0 9 * * *" \
--command "node ~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js"
或在升级后立即检查:
openclaw cron add \
--name "feishu-cache-post-upgrade" \
--schedule "@reboot" \
--command "sleep 30 && node ~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js"
文件位置
- 脚本:
scripts/check-and-fix.js - 目标文件:
/opt/homebrew/lib/node_modules/openclaw/extensions/feishu/src/probe.ts
缓存配置说明
修改的内容:
// 修改前(默认)
const PROBE_SUCCESS_TTL_MS = 10 * 60 * 1000; // 10 minutes
const PROBE_ERROR_TTL_MS = 60 * 1000; // 1 minute
// 修改后(优化)
const PROBE_SUCCESS_TTL_MS = 60 * 60 * 1000; // 60 minutes
const PROBE_ERROR_TTL_MS = 60 * 60 * 1000; // 60 minutes
效果
- 优化前:43,200 次/月(单账号)
- 优化后:720 次/月(单账号)
- 减少比例:98.3%
注意事项
- 每次 OpenClaw 升级后,probe.ts 可能被覆盖,需要重新应用优化
- 建议设置定时检查任务,确保配置始终有效
- 脚本会自动重启 Gateway,修复后立即生效
安全使用建议
This skill does what it says (it will patch probe.ts and restart the OpenClaw Gateway), but it modifies a globally installed OpenClaw extension file and may require elevated filesystem permissions. Before installing or running it: 1) Inspect the bundled script (it's included) line-by-line and verify the exact path matches your installation; 2) Back up the original probe.ts (and the containing package) so you can restore if something goes wrong; 3) Prefer running the script manually the first time rather than scheduling it; run it in a safe environment or container if possible; 4) Confirm you trust the author/repository (package.json points to a GitHub URL) and prefer getting a permanent fix upstream instead of repeatedly patching installed code; 5) Be aware you may need sudo/administrator rights to write /opt/homebrew/lib/node_modules and that the script will restart the Gateway (service interruption); 6) If you want lower risk, modify your deployment process to apply the fix during install/upgrade or ask the OpenClaw maintainers to integrate the change. If you need a checklist or a safer wrapper (dry-run, backup, confirmation prompt) I can draft one.
功能分析
Type: OpenClaw Skill
Name: feishu-cache-guardian
Version: 1.0.0
The skill performs automated source code modification and service management, which are high-risk administrative actions. Specifically, `scripts/check-and-fix.js` uses `fs.writeFileSync` to patch a file in a global system directory (`/opt/homebrew/lib/node_modules/openclaw/extensions/feishu/src/probe.ts`) and `execSync` to restart the OpenClaw gateway. While the stated intent of optimizing Feishu API cache settings is plausible and the code is not obfuscated, the capability to modify the underlying platform's source code and restart services warrants a suspicious classification due to the potential for unintended system instability or unauthorized configuration changes.
能力评估
Purpose & Capability
Name/description match the actual behavior: the script checks and patches probe.ts to change TTL constants to 60 minutes. However, the skill metadata declares no required config paths or privileges while the code targets a system-installed path (/opt/homebrew/lib/node_modules/openclaw/extensions/feishu/src/probe.ts). That missing declaration is an incoherence: the skill implicitly requires write access to a global module path but doesn't advertise it.
Instruction Scope
SKILL.md and the included script instruct the agent/user to read and overwrite a file under a global node_modules path and to run 'openclaw gateway restart'. These instructions reference system-level paths and a system command without explaining required privileges or making backups. The runtime instructions therefore go beyond innocuous checks and will modify another component of the installed OpenClaw runtime.
Install Mechanism
There is no install spec (instruction-only plus included script and package.json). No remote downloads or extraction steps are present. The included package.json points to a GitHub URL but the skill bundle contains the script for inspection, so there is no hidden install network action in the provided files.
Credentials
The skill declares no environment variables or credentials, yet it performs actions that require filesystem write permissions to a global package location and executes a gateway restart. Those privileges are not reflected in the manifest, and no guidance is given about required user permissions (e.g., whether sudo is needed). The script also modifies another plugin's source code (effectively acting across skill boundaries).
Persistence & Privilege
always is false and the skill is not forced into every run, which is good. However, the script writes to a global installed package file (other component's source) and restarts the Gateway. Modifying other skills' code and restarting services are system-level effects and should be considered a high-impact operation; the skill does this without declaring that it will change system-installed files.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install feishu-cache-guardian - 安装完成后,直接呼叫该 Skill 的名称或使用
/feishu-cache-guardian触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release:
- 自动检查 probe.ts 缓存配置
- 自动修复为60分钟缓存(飞书默认1分钟)
- 修复后自动重启 Gateway
问题背景:
- OpenClaw 飞书通道每分钟健康检查一次
- 默认配置每月产生 43,200 次 API 调用
- 远超飞书免费配额 10,000 次/月
解决方案:
- 自动将缓存时间从 1 分钟改为 60 分钟
- 优化后每月仅 720 次调用,节省 98.3%
- 每次 OpenClaw 升级后会覆盖修改,自动检测并修复
使用方法:
1. 手动运行:node scripts/check-and-fix.js
2. 或设置定时任务定期检查(建议每天定时检查)
元数据
常见问题
Feishu Cache Guardian 是什么?
飞书缓存配置守护工具。用于检查和修复 OpenClaw 飞书插件的 probe.ts 缓存配置。当飞书 API 健康检查的缓存时间被重置为默认值时,自动修复为60分钟缓存,避免API配额被快速耗尽。使用场景:OpenClaw升级后、飞书插件被覆盖后、定期检查缓存配置是否正常。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 381 次。
如何安装 Feishu Cache Guardian?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install feishu-cache-guardian」即可一键安装,无需额外配置。
Feishu Cache Guardian 是免费的吗?
是的,Feishu Cache Guardian 完全免费(开源免费),可自由下载、安装和使用。
Feishu Cache Guardian 支持哪些平台?
Feishu Cache Guardian 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Feishu Cache Guardian?
由 zhs0430-sudo(@zhs0430-sudo)开发并维护,当前版本 v1.0.0。
推荐 Skills