fix(config): respect model.context_length override for sub-64K models#9142
Open
Tranquil-Flow wants to merge 2 commits into
Open
fix(config): respect model.context_length override for sub-64K models#9142Tranquil-Flow wants to merge 2 commits into
Tranquil-Flow wants to merge 2 commits into
Conversation
This was referenced Apr 22, 2026
Collaborator
5 tasks
5366d07 to
06c0b81
Compare
|
Any support required to merge this PR in? it'll open hermes up to a huge section of the community who run local models. |
When users explicitly set model.context_length in config.yaml, the minimum 64K context check is now bypassed. Previously the check rejected models below 64K even when the user had already configured the override that the error message itself recommended. Closes NousResearch#8430
06c0b81 to
1efa93e
Compare
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?
When the user explicitly sets
model.context_lengthinconfig.yaml, the minimum 64K context check is now bypassed. Previously the check rejected models below 64K even when the user had already configured the override that the error message itself recommended.Why: Users of smaller models (e.g. Qwen3-235B-A22B with 32K context) were blocked from using Hermes Agent even after following the error message's instructions to set
model.context_lengthin config.How:
validate_minimum_context()function fromAIAgent.__init__so the validation logic is testableconfig_context_length is Noneguard so explicit overrides bypass the checkRelated Issue
Closes #8430
Type of Change
Changes Made
validate_minimum_context()function fromAIAgent.__init__so the validation logic is testableconfig_context_length is Noneguard so explicit overrides bypass the checktests/run_agent/test_minimum_context_length.py— 5 regression tests (reject without override, accept with override, boundary conditions, zero context)How to Test
pytest tests/run_agent/test_minimum_context_length.py -v— 5 tests passpytest tests/run_agent/test_switch_model_context.py -v— related tests pass (no regression)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs