fix(gateway): honor /model + channel_overrides in /new and /status banner - #62827
Closed
dickyudhandika wants to merge 1 commit into
Closed
fix(gateway): honor /model + channel_overrides in /new and /status banner#62827dickyudhandika wants to merge 1 commit into
dickyudhandika wants to merge 1 commit into
Conversation
…nner _format_session_info was reading model.default directly, so the /new auto-reset notice and /status banner advertised the global default even when the thread was pinned via channel_overrides or had a /model session override. The next agent turn ran on the override model, but the banner showed a different one — misleading at best, wrong at worst. Apply the same resolution chain as _resolve_session_agent_runtime: /model session override > channel_overrides > global default. Pass source through from _reset_notice_session_info (the only production caller from the reset path). The no-source path is preserved for CLI introspection where no channel context exists. Reported by a user running a Telegram thread pinned via channel_overrides to a custom provider model. The bug was in the gateway, not the provider config; the per-thread override just made it visible. Any thread using channel_overrides or a /model session override was affected.
Contributor
|
Thanks for isolating the reset-banner mismatch. The current reset path does reproduce the global-model display issue, but this patch needs a broader shared-resolution pass before it matches its stated Problems
Suggested changes
Automated hermes-sweeper review. |
This was referenced Jul 11, 2026
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?
_format_session_infowas readingmodel.defaultdirectly, so the/newauto-reset notice and/statusbanner advertised the global default even when the thread was pinned viachannel_overridesor had a/modelsession override. The next agent turn ran on the override model, but the banner showed a different one — misleading at best, wrong at worst.Fix:
_format_session_infoaccepts an optionalsourceand runs the same priority chain as_resolve_session_agent_runtime(/modelsession override →channel_overrides→ global default)._reset_notice_session_infopasses itssourcethrough. The no-source path is preserved for CLI introspection where no channel context exists.Related Issue
Reported by a user running a Telegram thread pinned via
channel_overridesto a custom provider model. The/newnotice kept advertising the global default while the next turn ran on the pinned model. The bug was in the gateway, not the provider config; the per-thread override just made it visible. Any thread usingchannel_overridesor a/modelsession override was affected.Type of Change
Changes Made
gateway/run.py—_format_session_info(source=None)now applies the priority chain (/model→channel_overrides→ global) whensourceis provided._reset_notice_session_infois updated to pass itssourcethrough. Multiplex-profile gating in the reset path is preserved.tests/gateway/test_format_session_info_overrides.py— 4 new tests covering: no source (CLI introspection path), channel override applies, no override thread falls back to global,/modelsession override wins over channel override.How to Test
venv/bin/python -m pytest tests/gateway/test_format_session_info_overrides.py -v→ 4 passedvenv/bin/python -m pytest tests/gateway/test_session_info.py tests/gateway/test_session_model_override_persistence.py tests/gateway/test_session_model_override_credential_pool.py tests/gateway/test_session_model_override_routing.py tests/gateway/test_session_model_reset.py tests/gateway/test_session_reset_notify.py tests/gateway/test_format_session_info_overrides.py -q→ 50 passedchannel_overrides, send/new, confirm the banner reports the pinned model rather than the global defaultChecklist
Code
Documentation & Housekeeping
_format_session_infowas updated inline