BobbyCat

飞书API接口调用次数优化

IT Ops & Securityv1.0.0
By BobbyCatUpdated 2026-05-11feishu-probe-optimize@clawhub_bobbycats/feishu-probe-optimize
Server OpsConfig Generation#Feishu#飞书

According to AlphaMoat, as of 2026-09, 飞书API接口调用次数优化 has 1,884 downloads and 1 stars — ranked #4,509 of 5,078 AI skills overall, and #254 of 264 in IT Ops & Security.

Installs
291
Downloads
1.9K
Stars
1
Overall Rank
#4,509
Top 89% overall · Top 97% in IT Ops & Security
PlatformInstallsDownloadsStarsComments
ClawHub ↗218521-
SkillHub ↗2911.9K1—

Platforms count differently and update at different times.

What this skill does

The Feishu extension's health check calls /open-apis/bot/v3/info every minute; default caches are 10 minutes on success and 1 minute on failure, so N accounts make about N×43,200 calls per month (129,600 for 3 accounts), easily exceeding Feishu's 50,000/month free quota. The fix extends caches to 24 hours on success and 1 hour on failure: 3 accounts then make only 90 calls per month, a 99.93% saving. Steps: edit the two TTL constants in probe.ts → run a full pnpm build (a single-extension build empties dist/extensions/ and crashes the gateway in a restart loop) → restart and verify openclaw-gateway. Major OpenClaw updates overwrite the file, so the change must be reapplied.

Profile published 2026-10-29

What you can do with it

  • Extend the Feishu extension's health-check cache durations
  • Follow the steps to edit probe.ts, run a full build and restart the gateway
  • Troubleshoot post-restart crashes or cache changes not taking effect

When to use it

  • When the Feishu free API quota is tight and calls must drop
  • When multi-account health checks make too many calls
  • When reapplying the cache optimization after an OpenClaw update

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Change the Feishu probe success cache to 24 hours.
Why does a single-extension build crash the gateway?
Check our current monthly Feishu API call volume.

Monthly Trend

Downloads1.9K
4131.2K2.0K2026-03 · Downloads 5222026-05 · Downloads 8552026-06 · Downloads 1.0K2026-07 · Downloads 1.3K2026-08 · Downloads 1.5K2026-09 · Downloads 1.9K26-0326-09
Stars1
0122026-03 · Stars 12026-05 · Stars 12026-06 · Stars 12026-07 · Stars 12026-08 · Stars 12026-09 · Stars 126-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-091.9K—1
2026-081.5K+17.7%1
2026-071.3K+29.3%1
2026-061.0K+18.9%1
2026-05855—1
2026-03522—1

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.8 KB · ClawHub v1.0.0
# 飞书 Probe 优化

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

## 问题背景

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

> **飞书免费额度**:每月 50,000 次(2026年3月)
Show all (150 lines)
### 默认配置

| 状态 | 缓存时间 |
|------|---------|
| 成功 | 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:定位文件

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

### 步骤 2:修改配置

打开 probe.ts,找到这两行:

```typescript
const PROBE_SUCCESS_TTL_MS = 10 * 60 * 1000; // 10 minutes
const PROBE_ERROR_TTL_MS = 60 * 1000; // 1 minute
```

修改为:

```typescript
const PROBE_SUCCESS_TTL_MS = 24 * 60 * 60 * 1000; // 24 hours
const PROBE_ERROR_TTL_MS = 60 * 60 * 1000; // 1 hour
```

### 步骤 3:全量编译

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

```bash
cd ~/.openclaw/workspace/openclaw
pnpm build
```

### 步骤 4:验证编译产物

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

### 步骤 5:重启服务

```bash
systemctl --user restart openclaw-gateway
```

### 步骤 6:验证服务状态

```bash
systemctl --user status openclaw-gateway
```

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

## 为什么必须全量编译?

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

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

## 故障排查

### 服务重启后崩溃

```bash
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

Popular in IT Ops & Security

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.