fix(feishu): honor explicit gateway disable#31468
Open
joelshu1 wants to merge 1 commit into
Open
Conversation
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes Feishu/Lark gateway startup respect an explicit disable even when Feishu credentials are present in the environment.
Concretely, it:
FEISHU_APP_IDandFEISHU_APP_SECRETauto-configure and enable the Feishu gateway when no disable is requested.FEISHU_GATEWAY_ENABLED=falsestyle values (false,0,off,no) to keep the gateway listener disabled while still loading Feishu credentials into the platform config metadata.feishu.enabled: falsefromconfig.yamlinstead of flipping the platform back on during env override processing.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_IDandFEISHU_APP_SECRETexisted, 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