← 返回 Skills 市场
bobbycats

飞书API接口调用次数优化

作者 BobbyCat · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
301
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install feishu-probe-optimize
功能描述
优化飞书扩展的 probe 缓存配置,将健康检查缓存延长至成功24小时、失败1小时,显著降低API调用次数。
使用说明 (SKILL.md)

飞书 Probe 优化

检测并优化飞书扩展的 probe 缓存配置,减少 API 调用次数。

问题背景

OpenClaw 的飞书扩展在每次健康检查时会调用飞书 Bot API /open-apis/bot/v3/info 来验证连接状态。健康检查每分钟执行一次。

飞书免费额度:每月 50,000 次(2026年3月)

默认配置

状态 缓存时间
成功 10 分钟
失败 1 分钟

默认情况下的 API 调用量

假设配置了 N 个飞书账号:

  • 每天调用:N × 24 × 60 = N × 1,440 次
  • 每月调用:N × 43,200 次

如果配置 3 个飞书账号,每月调用 129,600 次,很容易超过飞书免费配额。

优化方案

将缓存时间调整为更长间隔:

状态 默认时间 优化后时间
成功 10 分钟 24 小时
失败 1 分钟 1 小时

优化后的 API 调用量

  • 每天调用:N × 1 次 = N 次
  • 每月调用:N × 30 次

3 个账号:每月仅 90 次,节省 99.93%

新增飞书账号

每增加一个飞书账号,每 24 小时会增加 1 次 API 调用(成功情况下)。配置本身无需修改,缓存机制自动适配所有账号。

账号数 每天调用 每月调用
1 1 30
3 3 90
5 5 150
10 10 300

更新 OpenClaw 后

OpenClaw 大版本更新时,extensions/feishu/src/probe.ts 文件会被覆盖,缓存时间会恢复到默认值(10分钟/1分钟)。

更新后需要:

  1. 重新修改 probe.ts 中的缓存配置
  2. 执行全量编译:pnpm build
  3. 重启服务:systemctl --user restart openclaw-gateway

详见下文「使用步骤」。

使用步骤

步骤 1:定位文件

find ~/.openclaw/workspace/openclaw/extensions/feishu/src -name "probe.ts"

步骤 2:修改配置

打开 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 = 24 * 60 * 60 * 1000; // 24 hours
const PROBE_ERROR_TTL_MS = 60 * 60 * 1000; // 1 hour

步骤 3:全量编译

重要:必须执行全量编译,禁止单扩展编译。

cd ~/.openclaw/workspace/openclaw
pnpm build

步骤 4:验证编译产物

检查 dist/extensions/ 目录是否包含全部扩展(feishu、telegram 等)。如果只剩 feishu,说明编译方式错误。

步骤 5:重启服务

systemctl --user restart openclaw-gateway

步骤 6:验证服务状态

systemctl --user status openclaw-gateway

确认服务正常运行(active (running))。

为什么必须全量编译?

单扩展编译(如 pnpm --filter feishu build)会清空并覆盖 dist/extensions/ 目录,导致其他扩展的编译产物被删除。

重启后服务会因配置校验失败而崩溃,并进入循环重启。

故障排查

服务重启后崩溃

journalctl --user -u openclaw-gateway -n 50
  • 报错 plugin not found:dist 目录不完整,需要重新执行全量编译
  • 报错 Config invalid:检查 openclaw.json 中的扩展配置

缓存未生效

确认修改的是 extensions/feishu/src/probe.ts(源码),不是 dist/extensions/feishu/probe.js(编译产物)。

前后对比

指标 优化前(3账号) 优化后(3账号) 节省
每天调用 4,320 次 3 次 99.93%
每月调用 129,600 次 90 次 99.93%
每年调用 1,555,200 次 1,095 次 99.93%

更多信息

  • 飞书 Bot API 文档:https://open.feishu.cn/document/server-docs/bot-v3/bot-info
  • OpenClaw 飞书扩展:https://docs.openclaw.ai/channels/feishu
安全使用建议
This instruction set is coherent with the goal, but follow safe operational practices before applying: 1) Back up or commit the original probe.ts and any important config (openclaw.json). 2) Test changes in a staging environment if possible. 3) Ensure pnpm and build dependencies are available and be prepared for a full rebuild time/cost. 4) Edit the source file (not dist/compiled files) and verify the compiled output in dist/extensions before restarting. 5) Expect possible service downtime if the dist directory becomes incomplete; keep access to logs (journalctl) and a recovery plan. 6) Consider filing a PR or asking the OpenClaw maintainer for a configurable TTL as a safer long-term fix so updates don't revert your change.
功能分析
Type: OpenClaw Skill Name: feishu-probe-optimize Version: 1.0.0 The skill bundle provides instructions to optimize the Feishu extension's health check probe by increasing cache TTL values in 'probe.ts', reducing API consumption to stay within free tier limits. The instructions involve standard development operations such as modifying source code, running 'pnpm build', and restarting a systemd user service ('openclaw-gateway'), all of which are well-documented and align with the stated purpose without any signs of malicious intent or data exfiltration.
能力评估
Purpose & Capability
The skill's name/description match the runtime instructions: it tells you to edit the Feishu probe TTL constants, rebuild the OpenClaw workspace, and restart the user service. All required actions are directly related to reducing probe frequency.
Instruction Scope
Instructions require modifying a source file under ~/.openclaw/workspace and running a full pnpm build plus systemctl user restart. These steps are in-scope for changing probe behavior but carry operational risk (service downtime, build mistakes). The doc explicitly warns about compilation pitfalls and directs use of journalctl for troubleshooting; it does not request unrelated files, secrets, or external data exfiltration.
Install Mechanism
This is an instruction-only skill with no install spec, no downloads, and no code files. Nothing will be written or installed by the skill itself; actions are manual commands the operator runs.
Credentials
The skill requests no environment variables, credentials, or config paths. It does require write access to the user's workspace and permission to run systemctl --user, which is proportional to the task of updating and restarting the local service.
Persistence & Privilege
The skill does not request persistent special privileges or set always:true. However, the recommended workflow modifies local source and restarts a user service — this requires filesystem write access and the ability to control the user systemd service. Those are expected but carry operational impact if done incorrectly.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install feishu-probe-optimize
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /feishu-probe-optimize 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug feishu-probe-optimize
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

飞书API接口调用次数优化 是什么?

优化飞书扩展的 probe 缓存配置,将健康检查缓存延长至成功24小时、失败1小时,显著降低API调用次数。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 301 次。

如何安装 飞书API接口调用次数优化?

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

飞书API接口调用次数优化 是免费的吗?

是的,飞书API接口调用次数优化 完全免费(开源免费),可自由下载、安装和使用。

飞书API接口调用次数优化 支持哪些平台?

飞书API接口调用次数优化 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 飞书API接口调用次数优化?

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

💬 留言讨论