Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions plugins/platforms/feishu/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,26 +1447,6 @@ def _load_lark_oapi() -> bool:
return True


def feishu_deps_present() -> bool:
"""PASSIVE probe: is lark-oapi installed right now?

Registry ``check_fn`` — called from status displays and config loading,
so it must never install anything. Uses ``is_available`` (cheap
importlib.metadata lookups) instead of importing the SDK, which is
deferred to ``_load_lark_oapi`` at connect time. The ACTIVE
lazy-installer (``check_feishu_requirements``) is registered as
``ensure_deps_fn`` and runs from ``create_adapter()`` when this
returns False (#79812).
"""
if FEISHU_AVAILABLE:
return True
try:
from tools.lazy_deps import is_available
return is_available("platform.feishu")
except Exception: # pragma: no cover — defensive
return False


def check_feishu_requirements() -> bool:
"""Ensure Feishu dependencies are installed without importing the SDK."""
if FEISHU_AVAILABLE:
Expand Down Expand Up @@ -5877,8 +5857,7 @@ def register(ctx) -> None:
name="feishu",
label="Feishu / Lark",
adapter_factory=_build_adapter,
check_fn=feishu_deps_present,
ensure_deps_fn=check_feishu_requirements,
check_fn=check_feishu_requirements,
is_connected=_is_connected,
validate_config=_is_connected,
required_env=["FEISHU_APP_ID", "FEISHU_APP_SECRET"],
Expand Down