openclaw - 💡(How to fix) Fix Bug: Feishu plugin fails with 'Cannot destructure property tenant_access_token' [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59806Fetched 2026-04-08 02:40:21
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
commented ×1mentioned ×1subscribed ×1

Error Message

Feishu plugin fails to initialize with error: this.logger.error(e); // BUG: catches error but does NOT re-throw When the HTTP POST fails, the .catch() only logs the error but does not re-throw, so the function returns undefined. The code then tries to destructure tenant_access_token from undefined, causing the error. The real HTTP error is silently swallowed and hidden.

  • Expected: If token API fails, an error should be thrown with the actual cause
  • Actual: Error is caught and swallowed, then a confusing destructuring error appears

Root Cause

The bug is in @larksuiteoapi/[email protected] bundled with OpenClaw.

In the SDK's getCustomTenantAccessToken() method (file: extensions/feishu/node_modules/@larksuiteoapi/node-sdk/es/index.js, around line 83703):

const { tenant_access_token, expire } = yield this.httpInstance
    .post(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`, {
        app_id: this.appId,
        app_secret: this.appSecret,
    })
    .catch((e) => {
        this.logger.error(e);  // BUG: catches error but does NOT re-throw
    });
// When POST fails, returns undefined -> destructuring fails

When the HTTP POST fails, the .catch() only logs the error but does not re-throw, so the function returns undefined. The code then tries to destructure tenant_access_token from undefined, causing the error.

The real HTTP error is silently swallowed and hidden.

Fix Action

Workaround

None available - this is a SDK-level bug that needs OpenClaw to either:

  1. Patch the SDK code to re-throw in the catch block
  2. Wait for upstream SDK fix and update the bundled SDK version

Code Example

Cannot destructure property 'tenant_access_token' of '(intermediate value)' as it is undefined.

---

const { tenant_access_token, expire } = yield this.httpInstance
    .post(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`, {
        app_id: this.appId,
        app_secret: this.appSecret,
    })
    .catch((e) => {
        this.logger.error(e);  // BUG: catches error but does NOT re-throw
    });
// When POST fails, returns undefined -> destructuring fails
RAW_BUFFERClick to expand / collapse

Bug Description

Feishu plugin fails to initialize with error:

Cannot destructure property 'tenant_access_token' of '(intermediate value)' as it is undefined.

Environment

  • OpenClaw: 2026.4.1
  • Platform: Windows
  • Feishu SDK: @larksuiteoapi/[email protected] (bundled)

Root Cause

The bug is in @larksuiteoapi/[email protected] bundled with OpenClaw.

In the SDK's getCustomTenantAccessToken() method (file: extensions/feishu/node_modules/@larksuiteoapi/node-sdk/es/index.js, around line 83703):

const { tenant_access_token, expire } = yield this.httpInstance
    .post(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`, {
        app_id: this.appId,
        app_secret: this.appSecret,
    })
    .catch((e) => {
        this.logger.error(e);  // BUG: catches error but does NOT re-throw
    });
// When POST fails, returns undefined -> destructuring fails

When the HTTP POST fails, the .catch() only logs the error but does not re-throw, so the function returns undefined. The code then tries to destructure tenant_access_token from undefined, causing the error.

The real HTTP error is silently swallowed and hidden.

Expected vs Actual Behavior

  • Expected: If token API fails, an error should be thrown with the actual cause
  • Actual: Error is caught and swallowed, then a confusing destructuring error appears

Workaround

None available - this is a SDK-level bug that needs OpenClaw to either:

  1. Patch the SDK code to re-throw in the catch block
  2. Wait for upstream SDK fix and update the bundled SDK version

Additional Context

extent analysis

TL;DR

The Feishu plugin initialization error is likely due to a bug in the @larksuiteoapi/node-sdk where an HTTP POST error is caught but not re-thrown, causing a destructuring error.

Guidance

  • The issue is caused by the getCustomTenantAccessToken() method in the @larksuiteoapi/node-sdk not re-throwing the error when the HTTP POST fails, resulting in undefined being returned and causing a destructuring error.
  • To verify the issue, check the logs for any errors related to the HTTP POST request to https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal.
  • The bug can be mitigated by patching the SDK code to re-throw the error in the catch block, or by waiting for an upstream SDK fix and updating the bundled SDK version.
  • Check the OpenClaw version and Feishu SDK version to ensure they are compatible and up-to-date.

Example

const { tenant_access_token, expire } = yield this.httpInstance
    .post(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`, {
        app_id: this.appId,
        app_secret: this.appSecret,
    })
    .catch((e) => {
        this.logger.error(e);
        throw e; // re-throw the error
    });

Notes

The issue is specific to the @larksuiteoapi/node-sdk version 1.60.0 bundled with OpenClaw 2026.4.1, and may not affect other versions or platforms.

Recommendation

Apply workaround by patching the SDK code to re-throw the error in the catch block, as an upstream SDK fix may take time to be released and updating the bundled SDK version may not be feasible in the short term.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING