Skip to content

fix(feishu): honor explicit gateway disable#31468

Open
joelshu1 wants to merge 1 commit into
NousResearch:mainfrom
joelshu1:fix/feishu-explicit-disable
Open

fix(feishu): honor explicit gateway disable#31468
joelshu1 wants to merge 1 commit into
NousResearch:mainfrom
joelshu1:fix/feishu-explicit-disable

Conversation

@joelshu1

Copy link
Copy Markdown

Summary

This PR makes Feishu/Lark gateway startup respect an explicit disable even when Feishu credentials are present in the environment.

Concretely, it:

  • Keeps the existing default behavior where FEISHU_APP_ID and FEISHU_APP_SECRET auto-configure and enable the Feishu gateway when no disable is requested.
  • Adds support for FEISHU_GATEWAY_ENABLED=false style values (false, 0, off, no) to keep the gateway listener disabled while still loading Feishu credentials into the platform config metadata.
  • Preserves feishu.enabled: false from config.yaml instead of flipping the platform back on during env override processing.
  • Adds regression coverage for the default auto-enable path, env-level disable, explicit enabled config, and explicit disabled config.

Motivation

Some deployments need Feishu/Lark credentials available to Hermes for API/tool usage, but do not want a given gateway process to open the Feishu websocket. This is especially important in multi-profile or service-managed setups where only one process should own the Feishu gateway connection.

Before this change, the env override path could re-enable Feishu whenever FEISHU_APP_ID and FEISHU_APP_SECRET existed, even if the operator had explicitly disabled Feishu gateway startup. The result was surprising gateway startup behavior and possible duplicate Feishu websocket ownership.

This keeps credentials and gateway listener enablement separate: credentials can exist, while the gateway remains disabled when explicitly requested.

Tests

python -m py_compile gateway/config.py tests/gateway/test_config.py
python -m pytest -o addopts='' tests/gateway/test_config.py -q

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter area/config Config system, migrations, profiles labels May 24, 2026
@joelshu1

Copy link
Copy Markdown
Author

FYI good usecase for this is when we need all the access to feishu/lark tooling (messaging, docks, base etc) but dont need to actually use a gateway there! Common situation for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists 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