Skip to content

platforms.api_server config values (port, host, key) silently ignored when not nested under 'extra' #20501

@lepfinder

Description

@lepfinder

Bug Description

Configuration values for platforms.api_server (such as port, host, key, cors_origins) are silently ignored by the gateway when written at the top level of the api_server config block. The gateway silently falls back to defaults without any warning or error.

Root Cause

PlatformConfig.from_dict() in gateway/config.py (line 293-305) only reads from the extra dict:

return cls(
    enabled=_coerce_bool(data.get("enabled"), False),
    token=data.get("token"),
    api_key=data.get("api_key"),
    home_channel=home_channel,
    reply_to_mode=data.get("reply_to_mode", "first"),
    extra=data.get("extra", {}),  # <-- ONLY reads 'extra'
)

Meanwhile, hermes config set platforms.api_server.port 8643 writes the value at platforms.api_server.port directly, which is the natural and expected YAML structure. These top-level fields are never consumed.

Reproduction

  1. Run hermes config set platforms.api_server.port 8643
  2. Verify config.yaml now has:
    platforms:
      api_server:
        enabled: true
        port: 8643
  3. Start gateway: hermes gateway start
  4. Check lsof -i :8643 — nothing is listening
  5. Check lsof -i :8642 — gateway is on 8642 (the default), with no warning

Expected Behavior

  • hermes config set should either write values under extra automatically, OR
  • PlatformConfig.from_dict() should also read top-level keys like port, host, key, cors_origins and merge them into extra
  • At minimum, the gateway should log a warning when config values exist that it does not consume

Environment

  • Hermes Agent version: latest main (as of May 2026)
  • macOS, Python 3.12

Impact

This affects anyone running multiple Hermes profiles who needs to assign different ports. The bug is silent — no error, no warning — making it extremely difficult to debug. Users will think their config is not being picked up at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/configConfig system, migrations, profilescomp/gatewayGateway runner, session dispatch, deliverytype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions