fix(feishu): persist /sethome home channel to .env and load on startup#16870
Closed
ztexydt-cqh wants to merge 1 commit into
Closed
fix(feishu): persist /sethome home channel to .env and load on startup#16870ztexydt-cqh wants to merge 1 commit into
ztexydt-cqh wants to merge 1 commit into
Conversation
closes NousResearch#16806) The /sethome handler was writing the home channel to config.yaml as a top-level key, which load_gateway_config() never reads. This meant Feishu users had to run /sethome after every gateway restart. Changes: - gateway/run.py: use save_env_value() to write to .env instead of yaml - gateway/config.py: add Feishu yaml→env mapping for home_channel - hermes_cli/config.py: add FEISHU_HOME_CHANNEL to managed env keys
Contributor
|
Merged via #16900 — your fix landed on current main with your authorship preserved (commit 1d5e25f). Thank you! The
Your one-line fix in |
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.
Problem
Feishu
/sethomeappeared to succeed but the home channel was never persisted. After every gateway restart, users were prompted to run/sethomeagain.Root Cause
_handle_set_home_commandingateway/run.pywrote toconfig.yamlas a top-level key, butload_gateway_config()does not consume top-level{PLATFORM}_HOME_CHANNELkeys.gateway/config.pylacked a yaml→env mapping for Feishu, so even if the YAML had the value, it was never injected intoos.environ.Solution
.envviasave_env_value()(the same helper used by the setup wizard), which atomically updates the file and the current process environment.gateway/config.pyfor backward compatibility.FEISHU_HOME_CHANNELandFEISHU_HOME_CHANNEL_NAMEto_EXTRA_ENV_KEYSso they are treated as managed env vars.Files Changed
gateway/run.pygateway/config.pyhermes_cli/config.pyFixes #16806