fix(config): honor model.context_window as context_length alias - #15587
Open
novax635 wants to merge 1 commit into
Open
fix(config): honor model.context_window as context_length alias#15587novax635 wants to merge 1 commit into
novax635 wants to merge 1 commit into
Conversation
Collaborator
|
Likely duplicate of #8010 — same fix: honor model.context_window as alias for context_length in config override paths. |
novax635
marked this pull request as draft
April 25, 2026 10:23
novax635
marked this pull request as ready for review
April 25, 2026 10:23
Contributor
|
Thanks for tracing the agent and gateway override paths. Problems
Suggested changes
Automated hermes-sweeper review. |
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.
PR Description
This PR makes
model.context_windowwork as a compatibility alias formodel.context_lengthin explicit config override paths.Hermes already accepts
context_windowin model metadata parsing, but a few manual config-reading paths only checkedmodel.context_length. As a result, users who configured:could still see Hermes fall back to the detected/default context value instead of using the configured override.
This caused incorrect context behavior in agent initialization and gateway status/hygiene flows.
What was fixed
The following paths now read
model.context_windowwhenmodel.context_lengthis not set:run_agent.pygateway/run.pygateway/run.pymodel.context_lengthstill takes precedence when both values are present.Why this matters
Without this alias, users may believe they configured a larger context window, while Hermes silently ignores it in some runtime paths.
That can lead to:
Behavior
Priority order is now:
Invalid values continue to use the existing warning/fallback behavior.
Tests
Added regression coverage for the affected paths:
test_context_window_alias_workstest_context_window_aliastest_session_hygiene_honors_context_window_aliasResult: