fix(run_agent): read context_length from providers/custom_providers for compression model - #13813
fix(run_agent): read context_length from providers/custom_providers for compression model#13813ms-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
|
Related to #13540 which also targets the same compression context_length propagation gap via a different approach. |
1 similar comment
|
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 |
|
Thanks for identifying the auxiliary compression context-length propagation gap. This is now implemented on current
The later shared-path fix satisfies the PR's requested behavior without duplicating provider lookup logic in the compression check. |
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