Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion gateway/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11118,7 +11118,20 @@ async def _handle_message_with_agent(self, event, source, _quick_key: str, run_g
if not history and source.platform and source.platform != Platform.LOCAL and source.platform != Platform.WEBHOOK:
platform_name = source.platform.value
env_key = _home_target_env_var(platform_name)
if not os.getenv(env_key):
# Fix #10581: /sethome persists to .env + self.config, but .env only
# enters os.environ after a restart, so os.getenv() missed it and the
# "No home channel" prompt refired every new session. Fall back to
# self.config (updated immediately by sethome). (@Mason-zy)
_home_set = bool(os.getenv(env_key))
if not _home_set:
_pcfg = None
try:
_pcfg = self.config.platforms.get(source.platform)
except Exception:
_pcfg = None
if _pcfg and getattr(_pcfg, "home_channel", None):
_home_set = True
if not _home_set:
# Slack dispatches all Hermes commands through a single
# parent slash command `/hermes`; bare `/sethome` is not
# registered and would fail with "app did not respond".
Expand Down