Skip to content

fix(gateway): read multiplex_profiles from nested gateway section - #51372

Closed
davidgut1982 wants to merge 1 commit into
NousResearch:mainfrom
davidgut1982:fix/multiplex-profiles-nested-config
Closed

fix(gateway): read multiplex_profiles from nested gateway section#51372
davidgut1982 wants to merge 1 commit into
NousResearch:mainfrom
davidgut1982:fix/multiplex-profiles-nested-config

Conversation

@davidgut1982

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a config-loading bug where gateway.multiplex_profiles: true written under the nested gateway: section of config.yaml was silently ignored, so the gateway loaded with multiplex_profiles=False.

This is the form written by hermes config set gateway.multiplex_profiles true, so the documented CLI path to enable profile multiplexing did not actually take effect when set that way.

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Root cause

gateway/config.pyload_gateway_config() (around the multiplex_profiles block, ~line 851):

load_gateway_config() builds gw_data from the top-level keys of config.yaml and then calls GatewayConfig.from_dict(gw_data). from_dict() does honor the nested gateway.multiplex_profiles fallback — but only against the dict it is handed. Since load_gateway_config() only copied the top-level multiplex_profiles key into gw_data, the nested value never reached from_dict(), and the flag defaulted to False.

The sibling max_concurrent_sessions already had a nested-gateway: fallback in this same block; multiplex_profiles was missing the equivalent.

Changes Made

  • gateway/config.py: in load_gateway_config(), read gateway.multiplex_profiles into gw_data when the top-level key is absent, mirroring the existing nested fallback for max_concurrent_sessions.
  • tests/gateway/test_config.py: add TestLoadGatewayConfig::test_multiplex_profiles_from_nested_gateway_section — writes a config.yaml with gateway.multiplex_profiles: true, calls load_gateway_config(), and asserts cfg.multiplex_profiles is True.

How to Test

  1. Check out this branch, then run:
    pytest tests/gateway/test_config.py::TestLoadGatewayConfig::test_multiplex_profiles_from_nested_gateway_section -v
  2. Without the config.py change the test FAILS (assert False is Truemultiplex_profiles=False); with it the test PASSES.
  3. Full file is green: pytest tests/gateway/test_config.py -q → 70 passed.

Existing coverage gap: tests/gateway/test_multiplex_phase0.py only exercises GatewayConfig.from_dict, never load_gateway_config() with a YAML file — which is exactly where this bug lived.

Checklist

Code

  • My commit messages follow Conventional Commits (fix(gateway):)
  • My PR contains only changes related to this fix
  • I've added tests for my changes
  • Tested on Ubuntu (Linux), Python 3.13

🤖 Generated with Claude Code

load_gateway_config() only surfaced the top-level `multiplex_profiles`
key into gw_data before calling GatewayConfig.from_dict(). A config.yaml
that pinned the flag under the nested `gateway:` section -- the form
written by `hermes config set gateway.multiplex_profiles true` -- was
silently ignored, so the gateway loaded with multiplex_profiles=False.

from_dict() already honors the nested fallback, but load_gateway_config()
builds gw_data from top-level keys first, so the nested value never
reached it.

Read gateway.multiplex_profiles into gw_data when the top-level key is
absent, mirroring the existing nested fallback for max_concurrent_sessions.

Adds a load_gateway_config() regression test that writes a config.yaml
with `gateway.multiplex_profiles: true` and asserts the loaded config has
multiplex_profiles=True (fails without the fix).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists labels Jun 23, 2026
@davidgut1982
davidgut1982 marked this pull request as ready for review June 23, 2026 14:08

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Targeted fix: load_gateway_config() now reads multiplex_profiles from the nested gateway: section (the form written by hermes config set gateway.multiplex_profiles true), not just the top-level key.

Looks Good

  • Clean fix: adds a check for multiplex_profiles in the gateway_section dict
  • Test verifies the nested form is correctly loaded
  • 2 files changed, well-scoped
  • The comment update explains why the nested form matters

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused fix. This is an automated hermes-sweeper review; the change has already been salvaged onto current main with contributor authorship preserved.

@teknium1 teknium1 closed this Jul 15, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 15, 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:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants