fix(run_agent): read context_length from providers/custom_providers for compression model#13813
Open
ms-alan wants to merge 4 commits into
Open
fix(run_agent): read context_length from providers/custom_providers for compression model#13813ms-alan wants to merge 4 commits into
ms-alan wants to merge 4 commits into
Conversation
…or compression model When auxiliary.compression.model uses a custom provider with per-model context_length configured in providers/local-kimi.models.kimi-code.context_length, the compression feasibility check now looks up that value — mirroring the main model's existing providers lookup in __init__. Previously it only checked auxiliary.compression.context_length (explicit override) and endpoint auto-detection, ignoring the per-model config in providers. Closes NousResearch#13807
Collaborator
|
Related to #13540 which also targets the same compression context_length propagation gap via a different approach. |
1 similar comment
Collaborator
|
Related to #13540 which also targets the same compression context_length propagation gap via a different approach. |
|
Related: PR #17460 addresses the same root cause but with a more general approach. Instead of adding a providers lookup in |
This was referenced May 14, 2026
Closed
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
When
auxiliary.compression.modeluses a custom provider with per-modelcontext_lengthconfigured underproviders/<key>/models/<model>/context_length, the compression feasibility check now looks up that value — mirroring the main model's existing providers lookup in__init__.Root cause:
_aux_compression_context_length_configwas only populated fromauxiliary.compression.context_length(explicit override). The sameproviders/custom_providersper-modelcontext_lengthlookup that exists for the main model was missing for the auxiliary model.Fix: In
_prepare_compression(), added providers/custom_providers context_length lookup for the auxiliary compression model (mirrors the main model lookup ininit`)Testing
auxiliary.compression.provider: custom+auxiliary.compression.modelpointing to a local endpoint withcontext_length: 262141inproviders.local-kimi.models.kimi-code/kimi-code.context_lengthCloses #13807