fix(cli): clear Feishu home channel when setup prompt left blank (#12423) - #12451
fix(cli): clear Feishu home channel when setup prompt left blank (#12423)#124510x003600x wants to merge 1 commit into
Conversation
|
Thanks for putting this together — the fix approach is correct. However, this PR targets #58421 supersedes this PR — it targets the current file location and also fixes the same pattern across Discord, Slack, Mattermost, and WhatsApp (which all had the identical bug). It includes the whitespace-stripping, UX hint, and test coverage that were flagged in review here. Recommend closing this one in favor of #58421. |
|
Thanks for the focused regression coverage. The underlying behavior is still present on current main, but this PR now targets a removed setup surface. Problems
Suggested changes
Automated hermes-sweeper review. |
Problem
Interactive Feishu / Lark gateway setup (
_setup_feishu()inhermes_cli/gateway.py) only calledsave_env_value("FEISHU_HOME_CHANNEL", ...)when the user entered a non-empty home chat ID. Leaving the prompt blank kept any previously saved value in~/.hermes/.env, so users could not clear an optional home channel during reconfiguration (reported in #12423).Changes
save_env_valueas before.remove_env_value("FEISHU_HOME_CHANNEL")so the key is dropped from persisted env.print_infoline stating that an empty answer clears a previously saved home channel.print_success(" Home channel cleared.").Tests
_run_setup_feishumocks to recordremove_env_valuecalls.TestSetupFeishuHomeChannel: blank removes existing key, blank without prior key still invokes remove once, non-empty saves and does not remove.dict; injectHERMES_HOMEunderpatch.dict(..., clear=True)so adapter init does not rely onPath.home()with an emptied environment.Verification