Skip to content

fix(feishu): lazy-load setup client to avoid missing staged runtime deps during onboard#70339

Merged
steipete merged 1 commit into
openclaw:mainfrom
andrejtr:fix/feishu-onboard-lazy-load
Apr 23, 2026
Merged

fix(feishu): lazy-load setup client to avoid missing staged runtime deps during onboard#70339
steipete merged 1 commit into
openclaw:mainfrom
andrejtr:fix/feishu-onboard-lazy-load

Conversation

@andrejtr

@andrejtr andrejtr commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This fixes onboarding failures where Feishu setup paths eagerly loaded @larksuiteoapi/node-sdk before staged runtime dependencies were installed.

The fix makes Feishu client loading lazy in setup/tool-registration code paths, so openclaw onboard can load plugin setup surfaces without requiring Feishu runtime deps up front.

Fixes #70338, #70346, #70343

Root Cause

onboard loads bundled setup entries, which pulled Feishu modules with static imports of ./client.js, which in turn statically imported @larksuiteoapi/node-sdk.
Because this dependency is staged runtime-owned, it may not exist yet at setup-load time.

What Changed

  • Converted setup-path client acquisition to dynamic import / async flow across Feishu tool modules.
  • Updated callers to await async client getters.
  • Kept runtime behavior unchanged once clients are actually used.

Validation

  • pnpm tsgo:prod passed.
  • pnpm openclaw onboard --help now starts successfully without module-load failure.
  • Repro before: Cannot find module '@larksuiteoapi/node-sdk' in onboard setup load path.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS labels Apr 22, 2026
@greptile-apps

greptile-apps Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR converts static imports of ./client.js (which eagerly loads @larksuiteoapi/node-sdk) to dynamic await import("./client.js") calls across eight Feishu tool modules, making createFeishuToolClient async and propagating await to all call sites. The fix is targeted and correct — dynamic imports are module-cached by the runtime so there's no repeated load cost, and all call sites are already in async functions with appropriate error handling.

Confidence Score: 5/5

Safe to merge — all changes are consistent, call sites are properly awaited, and runtime behavior is unchanged once deps are present.

All eight changed files follow the same correct pattern: static import removed, dynamic import added inside the async function body, and every call site updated with await. The import type { createFeishuClient } retained in comment-reaction.ts is valid because it backs the ReturnType<typeof createFeishuClient> type alias used for FeishuCommentReactionClient. No P0/P1 findings.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(feishu): lazy-load client in setup p..." | Re-trigger Greptile

@steipete steipete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking findings. This is a focused Feishu hardening patch: it removes setup/tool registration-time static imports of , makes client acquisition dynamic at actual tool/runtime use, and updates the affected async call sites consistently. CI is green and the change is worth landing as defense-in-depth even though already fixes the broader bundled-deps cluster.

@steipete

Copy link
Copy Markdown
Contributor

Clarifying my approval text: the intended references were static imports of client.js and the current 2026.4.22 release. The approval stands; no blocking findings.

@steipete
steipete force-pushed the fix/feishu-onboard-lazy-load branch from 3c3948c to c2c6a59 Compare April 23, 2026 17:14
@steipete
steipete force-pushed the fix/feishu-onboard-lazy-load branch from c2c6a59 to 479abfc Compare April 23, 2026 17:19
@steipete
steipete force-pushed the fix/feishu-onboard-lazy-load branch from 479abfc to 77cb656 Compare April 23, 2026 17:26
@steipete
steipete force-pushed the fix/feishu-onboard-lazy-load branch from 77cb656 to 4d82d5e Compare April 23, 2026 17:32
@steipete
steipete merged commit 23c90ae into openclaw:main Apr 23, 2026
67 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Landed via squash after rewriting this to the setup-only barrel shape.\n\nProof:\n- local: pnpm test extensions/feishu/setup-entry.test.ts\n- local: pnpm check:changed\n- local Docker E2E: pnpm test:docker:bundled-channel-deps:fast\n- PR CI: green, including extension-fast (extension-fast-feishu, feishu), docker-e2e-fast, and install-smoke\n\nPR head: 4d82d5e5b65cb99a8e92a8d8e67b5b7452e92d57\nMerge: 23c90aeed41b691b94e2e3aae6439ad22f1b9e72\n\nThanks @andrejtr!

ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
Load Feishu setup surfaces through a setup-only barrel so onboarding does not import the Lark SDK before bundled runtime deps are staged.\n\nThanks @andrejtr.\n\nCo-authored-by: andrejtr <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Load Feishu setup surfaces through a setup-only barrel so onboarding does not import the Lark SDK before bundled runtime deps are staged.\n\nThanks @andrejtr.\n\nCo-authored-by: andrejtr <[email protected]>
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
Load Feishu setup surfaces through a setup-only barrel so onboarding does not import the Lark SDK before bundled runtime deps are staged.\n\nThanks @andrejtr.\n\nCo-authored-by: andrejtr <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Load Feishu setup surfaces through a setup-only barrel so onboarding does not import the Lark SDK before bundled runtime deps are staged.\n\nThanks @andrejtr.\n\nCo-authored-by: andrejtr <[email protected]>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Load Feishu setup surfaces through a setup-only barrel so onboarding does not import the Lark SDK before bundled runtime deps are staged.\n\nThanks @andrejtr.\n\nCo-authored-by: andrejtr <[email protected]>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Load Feishu setup surfaces through a setup-only barrel so onboarding does not import the Lark SDK before bundled runtime deps are staged.\n\nThanks @andrejtr.\n\nCo-authored-by: andrejtr <[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 size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openclaw status eagerly loads disabled channel plugins, crashing when bundled plugin deps aren't installed

2 participants