Skip to content

refactor(feishu): drop dead ensure_deps_fn path, fold lazy-install into check_fn - #81522

Closed
GodJones wants to merge 1 commit into
NousResearch:mainfrom
GodJones:feishu-cleanup-dead-deps
Closed

refactor(feishu): drop dead ensure_deps_fn path, fold lazy-install into check_fn#81522
GodJones wants to merge 1 commit into
NousResearch:mainfrom
GodJones:feishu-cleanup-dead-deps

Conversation

@GodJones

@GodJones GodJones commented Aug 8, 2026

Copy link
Copy Markdown

What

Removes the feishu_deps_present() passive probe and the ensure_deps_fn= registration in plugins/platforms/feishu/adapter.py::register(), folding the only live availability function (check_feishu_requirements) directly into check_fn.

Why it's safe (no behavior change in practice)

ensure_deps_fn is not referenced anywhere in the codebase. A tree-wide grep returns zero call sites — the field is dead config left over from when create_adapter() consumed it:

$ grep -rn ensure_deps_fn -- plugins/ tools/ gateway/ hermes_cli/
(empty)

So the prior registration:

check_fn=feishu_deps_present,            # is_available() — never installs
ensure_deps_fn=check_feishu_requirements, # ensure() — lazy-installs; DEAD, never called

already had its install path disabled. The only function that can actually run is check_feishu_requirements, which is now the single check_fn.

The effective runtime behavior is identical:

  • When FEISHU_AVAILABLE is true, both return True immediately — no SDK import, no install.
  • When deps are missing, check_feishu_requirements calls ensure("platform.feishu"), which was already the only reachable path (the feishu_deps_present branch could not install and the dead ensure_deps_fn never ran).

Motive

Two functions that must stay in sync to represent one concept (feishu availability) is a maintenance trap. Collapsing to one check_fn removes the dead field and the misleading "passive probe + active installer" split that no longer matches how the registry consumes it.

Risk note for reviewers

This touches the same register() entry the root_id fix PR (#81496) touched, but is otherwise unrelated and intentionally kept as a separate PR so each change traces to one clear request. No message-threading / root_id logic is modified here.

Refs: #79812 (original ensure_deps_fn wiring)

…to check_fn

ensure_deps_fn is no longer referenced anywhere in the codebase (grep
across the tree returns zero call sites), so the feishu_deps_present()
passive probe + the separate ensure_deps_fn registration is dead config.
check_feishu_requirements() is the only live availability function; fold
it directly into check_fn so the registry entry has a single source of
truth instead of two functions that must stay in sync.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins platform/feishu Feishu / Lark adapter labels Aug 8, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #80305 separated the passive check_fn from the active lazy installer to avoid status/config checks causing SDK installation. This diff reassigns the active check_feishu_requirements() function to check_fn, so it needs behavior review rather than being treated as a no-op refactor.

@GodJones

GodJones commented Aug 8, 2026

Copy link
Copy Markdown
Author

Closing per the triage note — thanks @alt-glitch. #80305 deliberately separated the passive check_fn (status/config probes must not trigger SDK install) from the active lazy installer, and this PR re-collapsed them, which is the wrong direction. The feishu_deps_present probe + ensure_deps_fn separation stays as-is; this cleanup isn't worth undoing that contract. The companion fix #81496 (root_id fallback removal) is the actual bug fix and remains open.

@GodJones GodJones closed this Aug 8, 2026
@GodJones
GodJones deleted the feishu-cleanup-dead-deps branch August 8, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/feishu Feishu / Lark adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants