Skip to content

feat(feishu): add quota optimization flags#10513

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
BigUncle:feat/feishu-quota-optimization
Feb 28, 2026
Merged

feat(feishu): add quota optimization flags#10513
Takhoffman merged 2 commits intoopenclaw:mainfrom
BigUncle:feat/feishu-quota-optimization

Conversation

@BigUncle
Copy link
Copy Markdown
Contributor

@BigUncle BigUncle commented Feb 6, 2026

Summary

  • add optional Feishu config flags to reduce API quota usage
  • allow disabling typing indicator and sender name resolution
  • defaults keep existing behavior (backwards compatible)

Motivation

Feishu free-tier API quota is tight; these opt-out flags let users reduce unnecessary
requests without changing defaults.

Changes

  • add typingIndicator and resolveSenderNames to Feishu config schema
  • guard sender-name resolution and typing indicator calls behind these flags

Notes

  • default behavior unchanged unless user explicitly sets flags to false

Greptile Overview

Greptile Summary

  • Adds two optional Feishu config flags (typingIndicator, resolveSenderNames) intended to reduce free-tier API quota usage.
  • Updates Feishu Zod config schemas to include these flags, with top-level defaults preserving existing behavior.
  • Guards sender-name resolution in message handling and typing-indicator reactions in the reply dispatcher behind the new flags.

Confidence Score: 3/5

  • This PR is not safe to merge until a scope/compilation issue in bot.ts is fixed.
  • The new config flags are straightforward, but permissionErrorForAgent appears to have been moved under a conditional without a matching outer-scope declaration, breaking the later permission-notification path and likely failing build/typecheck.
  • extensions/feishu/src/bot.ts

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

@openclaw-barnacle openclaw-barnacle bot added the channel: feishu Channel integration: feishu label Feb 6, 2026
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 6, 2026

Additional Comments (1)

extensions/feishu/src/bot.ts
Permission error variable scope

permissionErrorForAgent is assigned inside the resolveSenderNames flag block, but it is no longer declared in the function scope (it used to be declared before the block). This will be a runtime/TS error (or will reference an outer variable unintentionally) and also breaks the later if (permissionErrorForAgent) notification path.

  // Track permission error to inform agent later (with cooldown to avoid repetition)
  let permissionErrorForAgent: PermissionError | undefined;

  // Resolve sender display name (best-effort) so the agent can attribute messages correctly.
  // Optimization: skip if disabled to save API quota (Feishu free tier limit)
  if (feishuCfg?.resolveSenderNames !== false) {
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/feishu/src/bot.ts
Line: 526:529

Comment:
**Permission error variable scope**

`permissionErrorForAgent` is assigned inside the `resolveSenderNames` flag block, but it is no longer declared in the function scope (it used to be declared before the block). This will be a runtime/TS error (or will reference an outer variable unintentionally) and also breaks the later `if (permissionErrorForAgent)` notification path.

```suggestion
  // Track permission error to inform agent later (with cooldown to avoid repetition)
  let permissionErrorForAgent: PermissionError | undefined;

  // Resolve sender display name (best-effort) so the agent can attribute messages correctly.
  // Optimization: skip if disabled to save API quota (Feishu free tier limit)
  if (feishuCfg?.resolveSenderNames !== false) {
```


How can I resolve this? If you propose a fix, please make it concise.

@BigUncle BigUncle force-pushed the feat/feishu-quota-optimization branch 3 times, most recently from b016bad to 48a28c5 Compare February 10, 2026 16:35
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels Feb 21, 2026
@Takhoffman
Copy link
Copy Markdown
Contributor

The feature idea is good, but this PR is not ready to land in current form.

What is good:

  • typingIndicator and resolveSenderNames toggles are sensible quota controls.
  • Default-true behavior preserves backward compatibility.

What is missing/blocking:

  • No focused tests proving behavior when flags are false/true in both top-level and per-account merged config.
  • No docs/config examples to make the new flags discoverable.
  • PR is stale/dirty relative to current main; it needs a refresh against latest Feishu typing/sender handling changes.

Recommended next step:

  1. Rebase onto current main.
  2. Add tests for both toggles in message handling + reply dispatcher paths.
  3. Add short docs/config snippets for channels.feishu.typingIndicator and channels.feishu.resolveSenderNames.

@Takhoffman Takhoffman force-pushed the feat/feishu-quota-optimization branch from 48a28c5 to 482316b Compare February 28, 2026 05:05
@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation size: S labels Feb 28, 2026
@Takhoffman Takhoffman merged commit 27882dc into openclaw:main Feb 28, 2026
10 checks passed
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit fe0659a)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit fe0659a)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit fe0659a)
@BigUncle BigUncle deleted the feat/feishu-quota-optimization branch February 28, 2026 14:40
vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
newtontech pushed a commit to newtontech/openclaw-fork that referenced this pull request Feb 28, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 27882dc)

# Conflicts:
#	CHANGELOG.md
#	extensions/feishu/src/bot.ts
#	extensions/feishu/src/config-schema.ts
zooqueen added a commit to hanzoai/bot that referenced this pull request Mar 1, 2026
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
venjiang pushed a commit to venjiang/openclaw that referenced this pull request Mar 2, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 27882dc)

# Conflicts:
#	CHANGELOG.md
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
zooqueen added a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
Mateljan1 pushed a commit to Mateljan1/openclaw that referenced this pull request Mar 7, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
…igUncle

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 27882dc)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
…igUncle (#1471)

Verified:
- pnpm build
- pnpm check
- pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/config-schema.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/feishu/src/bot.test.ts



(cherry picked from commit 27882dc)

Co-authored-by: BigUncle <[email protected]>
Co-authored-by: BigUncle <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu docs Improvements or additions to documentation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants