fix(config): redirect platforms.<name>.<display_setting> to display.platforms.<name>.<setting> (#71047) - #78111
Open
zoser69 wants to merge 1 commit into
Conversation
…latforms.<name>.<setting> Problem A of NousResearch#71047: 'hermes config set platforms.telegram.streaming false' wrote to a key the gateway never reads. The connection config (gateway/config.py) reads only token/extra/overrides from the top-level platforms.<name> block, while per-platform display settings (streaming, show_reasoning, tool_progress, ...) are resolved from display.platforms.<name>.<setting> (gateway/display_config.py). Redirect a platforms.<name>.<setting> key to display.platforms.<name>.<setting> only when <setting> is a known per-platform display setting (gateway.display_config.OVERRIDEABLE_KEYS), leaving real connection keys (token, extra, channel_overrides, ...) untouched. The gateway.display_config import is lazy/try-guarded to avoid a circular import and to keep the CLI working where gateway is not importable. Adds tests/hermes_cli/test_config_set_platforms_redirect.py covering the redirect, connection-key non-redirect, and the no-stray-top-level-platforms case.
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.
Summary
Fixes Problem A of #71047:
hermes config set platforms.<name>.<display_setting> <value>writes to a key the runtime never reads, so the edit appears to succeed while having no effect.Root cause: the gateway reads per-platform display settings (streaming, show_reasoning, tool_progress, …) from
display.platforms.<name>.<setting>(seegateway/display_config.py::resolve_display_setting), while the top-levelplatforms.<name>block holds only connection config (token, extra, channel_overrides).set_config_valuewrote the dotted path verbatim, soplatforms.telegram.streaminglanded in the connection block and was silently ignored by the loader.This mirrors the existing set-time alias/redirect pattern already in
set_config_value(model.api_base → model.base_url, baremodel → model.default).Fix
In
hermes_cli/config.py::set_config_value, before the write, redirect aplatforms.<name>.<setting>key todisplay.platforms.<name>.<setting>only when<setting>is a known per-platform display setting (gateway.display_config.OVERRIDEABLE_KEYS). Real connection keys (token,extra,channel_overrides, …) are left untouched. Thegateway.display_configimport is lazy/try-guarded to avoid a circular import (gateway/config.pyalready importshermes_cli.config) and to keep the CLI working in minimal installs wheregatewayis not importable.Scope
This PR addresses only Problem A (the config-set duplicate/mis-targeted key). Problem B (Telegram streaming resend duplication) is a separate runtime issue and intentionally out of scope here, per the triage recommendation to keep the fix focused.
Test plan
tests/hermes_cli/test_config_set_platforms_redirect.py:platforms.telegram.streaming false→display.platforms.telegram.streaming: false(bool-coerced), and no straystreamingkey under the top-levelplatforms.telegramconnection block.platforms.telegram.show_reasoning/platforms.discord.tool_progressredirect correctly.platforms.telegram.token) is not redirected.platformsblock exists, the redirect does not invent one — it writes onlydisplay.platforms....Closes #71047 (Problem A)