Skip to content

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

Merged
davidgut1982 merged 1 commit into
mpm-prodfrom
fork/multiplex-profiles-nested-config
Jun 23, 2026
Merged

fix(gateway): read multiplex_profiles from nested gateway section#17
davidgut1982 merged 1 commit into
mpm-prodfrom
fork/multiplex-profiles-nested-config

Conversation

@davidgut1982

Copy link
Copy Markdown
Owner

What does this PR do?

Lands the multiplex_profiles nested-config fix into mpm-prod.

load_gateway_config() ignored gateway.multiplex_profiles: true written under the nested gateway: section of config.yaml (the form written by hermes config set gateway.multiplex_profiles true), so the gateway loaded with multiplex_profiles=False.

Type of Change

  • 🐛 Bug fix

Root cause

gateway/config.pyload_gateway_config() builds gw_data from the top-level keys and then calls from_dict(). from_dict() honors the nested gateway.multiplex_profiles fallback, but load_gateway_config() only copied the top-level key into gw_data, so the nested value never reached from_dict(). The sibling max_concurrent_sessions already had this nested fallback; multiplex_profiles was missing it.

Changes Made

  • gateway/config.py: read gateway.multiplex_profiles into gw_data when the top-level key is absent.
  • tests/gateway/test_config.py: regression test TestLoadGatewayConfig::test_multiplex_profiles_from_nested_gateway_section.

How to Test

  1. 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.
  2. pytest tests/gateway/test_config.py -q → 70 passed.

This branch is based on NousResearch/hermes-agent@main so it is the exact same commit proposed upstream (draft PR NousResearch#51372).

🤖 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>
@davidgut1982
davidgut1982 merged commit 1ee3ff5 into mpm-prod Jun 23, 2026
7 checks passed
@davidgut1982
davidgut1982 deleted the fork/multiplex-profiles-nested-config branch June 23, 2026 14:08
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant