feishu-cache-guardian

飞书缓存配置守护工具。用于检查和修复 OpenClaw 飞书插件的 probe.ts 缓存配置。当飞书 API 健康检查的缓存时间被重置为默认值时,自动修复为60分钟缓存,避免API配额被快速耗尽。使用场景:OpenClaw升级后、飞书插件被覆盖后、定期检查缓存配置是否正常。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "feishu-cache-guardian" with this command: npx skills add zhs0430-sudo/feishu-cache-guardian

Feishu Cache Guardian - 飞书缓存守护

背景

OpenClaw 的飞书通道每分钟会执行一次健康检查,调用 probeFeishu() 函数获取机器人信息。如果没有缓存机制,每月会产生约 43,200 次 API 调用,远超飞书免费配额的 10,000 次/月。

郑工长的优化方案添加了缓存机制:

  • 成功响应缓存 60 分钟
  • 失败响应缓存 60 分钟

问题:每次 OpenClaw 升级都会覆盖 probe.ts 文件,导致优化失效。

功能

本技能提供自动检查和修复功能:

  1. 检查 probe.ts 的缓存配置是否为 60 分钟
  2. 如果被重置为默认值,自动修复
  3. 修复后自动重启 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%

注意事项

  1. 每次 OpenClaw 升级后,probe.ts 可能被覆盖,需要重新应用优化
  2. 建议设置定时检查任务,确保配置始终有效
  3. 脚本会自动重启 Gateway,修复后立即生效

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Token省钱管家

OpenClaw Token省钱管家 - 智能缓存、动态路由、实时监控,运行时自动优化,降低70%成本消耗。当用户询问成本优化、Token节省、缓存策略、模型路由或需要成本监控时使用。

Registry SourceRecently Updated
1200Profile unavailable
Automation

Tokenoptimizer

Reduce OpenClaw AI costs by 97%. Haiku model routing, free Ollama heartbeats, prompt caching, and budget controls. Go from $1,500/month to $50/month in 5 min...

Registry Source
9.1K23Profile unavailable
General

上下文窗口优化器

上下文窗口优化器 - 原创技能。智能管理AI上下文窗口,自动压缩历史、去除冗余、保留关键信息,节省token提升效率。适用于长会话、多文件、大项目等场景。

Registry SourceRecently Updated
General

feishu-group-memory-system-飞书群聊记忆管理

飞书群聊上下文持久化技能。当用户在群聊中说"保存上下文"时保存当前群聊对话;在私聊中会根据用户意图分流到手动群聊存档或其他操作。

Registry SourceRecently Updated
1851Profile unavailable