fix(gateway): fall back to self.config for home-channel prompt - #59348
fix(gateway): fall back to self.config for home-channel prompt#59348Mason-zy wants to merge 1 commit into
Conversation
Related: this fixes #10581, which already has a saturated cluster of competing OPEN fixes at the same code site ( |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Changes
Fixes a regression in the "no home channel" prompt re-firing on every new session. Previously, /sethome persisted to .env + self.config, but os.getenv() missed the .env value until a restart. Now falls back to self.config.platforms[source.platform].home_channel when the env var is not set.
Quality
- Targeted fix: only changes the specific conditional that caused the regression
- Clean fallback chain: env var first, then config lookup, then the "no home" path
- No security or correctness concerns
Suggestions
- None
Reviewed by Hermes Agent
tonydwb
left a comment
There was a problem hiding this comment.
Code Review
COMMENT: fix(gateway): fall back to self.config for home-channel prompt
Small gateway fix (14 additions, 1 deletion). No security concerns.
Reviewed by Hermes Agent
Backport of NousResearch/hermes-agent#59348 (upstream issue #10581). The 'No home channel is set' prompt only checked os.getenv(), but /sethome persists to .env + self.config (os.environ only sees .env after restart). Within a running process the prompt refired on every new session. Add self.config fallback so it respects what /sethome actually wrote.
|
Thanks for the focused fix. The premise remains valid on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
Problem
The "📬 No home channel is set..." prompt keeps refiring on every new session even after the user has run
/sethome. Tracked in #10581.Root cause
The prompt check in
gateway/run.pyonly reads the env var:But
_handle_set_home_commandpersists the home channel to.env+self.config, not toos.environ. The.envvalue only entersos.environafter a gateway restart, so within a running processos.getenv()never sees it — and the prompt refires on every fresh session (not history)./sethomealready updatesself.config.platforms[platform].home_channelin-memory immediately, but the prompt check ignores it.Fix
Also consult
self.configbefore deciding to show the prompt:Now the prompt respects whichever source
/sethomeactually wrote to, and stops refiring once a home channel is set — without requiring a restart.Closes #10581.