Skip to content

fix: allow home channel from config.yaml to be recognized - #12391

Open
h6y3-aegis wants to merge 1 commit into
NousResearch:mainfrom
h6y3-aegis:fix/home-channel-config-check
Open

fix: allow home channel from config.yaml to be recognized#12391
h6y3-aegis wants to merge 1 commit into
NousResearch:mainfrom
h6y3-aegis:fix/home-channel-config-check

Conversation

@h6y3-aegis

Copy link
Copy Markdown

Summary

The _handle_home_channel_check() in run.py only looked at environment variables via os.getenv(), missing home channels set via /sethome in config.yaml.

Problem

When users ran /sethome to set their home channel, the value was saved to config.yaml as a top-level key (e.g., SLACK_HOME_CHANNEL). However, on subsequent runs, the _handle_home_channel_check function only checked os.getenv(), which doesn't see values from the loaded config. This caused users to receive repeated "home not set" notifications despite having configured it.

Changes Made

  1. gateway/run.py: Updated _handle_home_channel_check to also check config.platforms[platform].home_channel
  2. gateway/config.py: Added _apply_config_home_channels() to load home channels from config.yaml's top-level keys on startup
  3. gateway/config.py: Added support for legacy gateway.home_channel as fallback
  4. gateway/run.py: Updated /sethome command handler to update in-memory config immediately (no restart required)

Testing

  • Home channel is now properly recognized from config.yaml without requiring a restart
  • /sethome changes take effect immediately

Fixes the issue where users saw repeated 'home not set' notifications after using /sethome

The _handle_home_channel_check() in run.py only looked at environment
variables via os.getenv(), missing home channels set via /sethome in
config.yaml (which stores them as top-level keys like SLACK_HOME_CHANNEL).

Changes:
- Updated _handle_home_channel_check to also check
  config.platforms[platform].home_channel
- Added _apply_config_home_channels() in config.py to load home
  channels from config.yaml on startup
- Added support for legacy gateway.home_channel key as fallback
- Updated /sethome command to also update in-memory config immediately

Fixes repeated 'home not set' notifications when /sethome was used.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery area/config Config system, migrations, profiles labels Apr 23, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for isolating the repeated onboarding notice. The underlying same-process issue is still present on current main, but this branch targets pre-refactor code and includes config loading that no longer matches /sethome persistence.

Problems

  • gateway/run.py:11402 still checks only os.getenv(env_key), so the prompt can refire. However, /sethome now lives in gateway/slash_commands.py:2418 after 619bd7827; it saves through save_env_value() at lines 2430-2436 and updates self.config at lines 2440-2452.
  • The proposed top-level config.yaml mapping is not the current /sethome persistence path. The needed repair is the narrow self.config fallback at the current notice check.
  • Please add coverage for an unset environment variable plus a populated in-memory home channel. Current tests cover those pieces separately in tests/gateway/test_restart_notification.py:182 and tests/gateway/test_status_command.py:435.

Suggested changes

  • Re-target the focused fallback to gateway/run.py:11402, preferably via self.config.get_home_channel(source.platform), and add the regression test.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants