fix(gateway): read multiplex_profiles from nested gateway section - #17
Merged
Merged
Conversation
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>
davidgut1982
pushed a commit
that referenced
this pull request
Jul 7, 2026
…_adapter_for_source The routing sweep sends these paths through _adapter_for_source, which reads source.profile. A bare MagicMock auto-attribute is truthy, so the fixtures looked like stamped secondary profiles and hit the new fail-closed branch. Real SessionSource.profile is None or str (AGENTS.md pitfall #17).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Lands the multiplex_profiles nested-config fix into
mpm-prod.load_gateway_config()ignoredgateway.multiplex_profiles: truewritten under the nestedgateway:section ofconfig.yaml(the form written byhermes config set gateway.multiplex_profiles true), so the gateway loaded withmultiplex_profiles=False.Type of Change
Root cause
gateway/config.py—load_gateway_config()buildsgw_datafrom the top-level keys and then callsfrom_dict().from_dict()honors the nestedgateway.multiplex_profilesfallback, butload_gateway_config()only copied the top-level key intogw_data, so the nested value never reachedfrom_dict(). The siblingmax_concurrent_sessionsalready had this nested fallback;multiplex_profileswas missing it.Changes Made
gateway/config.py: readgateway.multiplex_profilesintogw_datawhen the top-level key is absent.tests/gateway/test_config.py: regression testTestLoadGatewayConfig::test_multiplex_profiles_from_nested_gateway_section.How to Test
pytest tests/gateway/test_config.py::TestLoadGatewayConfig::test_multiplex_profiles_from_nested_gateway_section -v— FAILS without the fix (assert False is True), PASSES with it.pytest tests/gateway/test_config.py -q→ 70 passed.This branch is based on
NousResearch/hermes-agent@mainso it is the exact same commit proposed upstream (draft PR NousResearch#51372).🤖 Generated with Claude Code