fix(run_agent): pass custom_providers to compression feasibility check (#20608) - #20724
Closed
Beandon13 wants to merge 1 commit into
Closed
Conversation
…compression feasibility check (NousResearch#20608) _check_compression_model_feasibility() called get_model_context_length() without the custom_providers argument. The main model path in the same file (lines 2039, 2436) correctly passes custom_providers, but the compression feasibility check omitted it. As a result, step 0b (per-model context_length lookup in custom_providers) was skipped and resolution fell through to the 256K default, producing a spurious "Auto-lowered threshold" warning at startup for any user with a custom provider model as their compression model. Fix loads custom_providers via load_config/get_compatible_custom_providers (mirroring the pattern at line 2429) and forwards it to get_model_context_length. Updated three existing tests that asserted the exact call signature to include custom_providers=. Added test_feasibility_check_passes_custom_providers as a regression test confirming the kwarg is forwarded. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
13 tasks
This was referenced May 11, 2026
Closed
Contributor
|
Automated hermes-sweeper review: this PR's fix is already present on current main. Evidence:
Thanks for the useful duplicate fix and regression context around #20608. |
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.
Bug
_check_compression_model_feasibility()callsget_model_context_length()without thecustom_providersargument. The main model path in the same file (lines 2039, 2436) correctly passescustom_providers, but the compression check omits it.get_model_context_lengthhas step 0b that checkscustom_providersfor per-modelcontext_lengthoverrides — but only whencustom_providersis passed. When omitted, step 0b is skipped and resolution falls through to the 256K default, causing a spurious startup warning:This happens even when the custom provider defines
context_length: 1000000for that model inconfig.yaml.Fix
Load
custom_providersviaload_config()/get_compatible_custom_providers()(mirroring the existing pattern at line ~2429) and forward it toget_model_context_length()inside_check_compression_model_feasibility().Broken call (before):
Fixed call (after):
Tests
get_model_context_lengthto includecustom_providers=None(they now patchload_config+get_compatible_custom_providersto returnNone).test_feasibility_check_passes_custom_providers— regression test confirmingcustom_providersis forwarded when set, and that no spurious warning is emitted when the custom provider reports 1M context.Closes #20608