Skip to content

fix(agent): propagate custom provider context to compression checks#14152

Open
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/aux-compression-custom-context-12977
Open

fix(agent): propagate custom provider context to compression checks#14152
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/aux-compression-custom-context-12977

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • reuse the same custom provider context_length resolution for both main-model startup and auxiliary compression feasibility checks
  • pass custom_providers.models..context_length through when compression falls back to the main custom provider model
  • avoid duplicate invalid-context warnings when the same bad custom provider entry is touched by both startup paths
  • add a regression covering the auxiliary fallback case

Testing

  • python3 -m pytest -o addopts= tests/run_agent/test_compression_feasibility.py -k "custom_provider_context_length or passes_config_context_length or ignores_invalid_context_length"
  • python3 -m pytest -o addopts= tests/run_agent/test_compression_feasibility.py
  • python3 -m pytest -o addopts= tests/run_agent/test_invalid_context_length_warning.py

Closes #12977

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder labels Apr 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #13540 — same root cause: custom_providers.models.context_length not passed to aux compression feasibility check. Both close #12977. See also #14119.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #13540.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: custom_providers.models.context_length not propagated to auxiliary compression feasibility check

2 participants