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 was referenced Jun 17, 2026
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the Feishu credential/listener coupling; the underlying defect is still present on current main at gateway/config.py:1871-1876.
Problems
- The proposed branch only enables a newly absent platform. If
platforms.feishualready exists without an explicitenabledkey—for example, the documentedextratuning block atwebsite/docs/user-guide/messaging/feishu.md:478-484—itsPlatformConfigdefaults to disabled and the PR leaves it disabled despite valid credentials. - Current main already has the required precedence primitive:
_enable_from_env()atgateway/config.py:1453-1468enables implicit configs but retains_enabled_explicitdisables. PR #47807's linked alternative uses that helper and includes this missing regression case.
Suggested changes
- Salvage the Feishu block through
_enable_from_env(Platform.FEISHU)and add the existing-config-without-enabled regression test. - Use
platforms.feishu.enabled: falsefor the listener opt-out unless a separate environment override is deliberately adopted and documented.
Automated hermes-sweeper review.
| if Platform.FEISHU not in config.platforms: | ||
| config.platforms[Platform.FEISHU] = PlatformConfig() | ||
| config.platforms[Platform.FEISHU].enabled = True | ||
| config.platforms[Platform.FEISHU] = PlatformConfig(enabled=feishu_gateway_enabled) |
Contributor
There was a problem hiding this comment.
When Feishu already exists in config but has no explicit enabled key, this branch leaves its default enabled=False unchanged despite credentials. Use the current _enable_from_env(Platform.FEISHU) helper so implicit configs auto-enable while _enabled_explicit disables remain respected.
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