Skip to content

fix(compression): pass custom providers to feasibility check - #23788

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/23779-compression-custom-providers
Closed

fix(compression): pass custom providers to feasibility check#23788
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/23779-compression-custom-providers

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

What does this PR do?

Passes custom_providers through _check_compression_model_feasibility() so auxiliary compression models inherit per-model context_length overrides the same way the main model path already does. This avoids false 256K startup warnings when the compression model resolves through a custom provider entry with a larger configured context window.

Related Issue

Fixes #23779

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Forwarded custom_providers into get_model_context_length() inside run_agent.py::_check_compression_model_feasibility()
  • Reused live config loading in the feasibility check so auxiliary custom-provider overrides stay aligned with the main-model and switch-model paths
  • Added a regression test proving the feasibility check forwards custom provider metadata for the auxiliary compression model
  • Updated existing feasibility assertions to match the helper's current empty-list fallback shape

How to Test

  1. Run uv run --frozen pytest -q -o addopts='' tests/run_agent/test_compression_feasibility.py
  2. Run uv run --frozen ruff check run_agent.py tests/run_agent/test_compression_feasibility.py
  3. Confirm test_feasibility_check_passes_custom_providers asserts the auxiliary feasibility lookup receives the configured custom_providers list

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.5

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

  • 17 passed in 1.01s from tests/run_agent/test_compression_feasibility.py
  • All checks passed! from ruff check run_agent.py tests/run_agent/test_compression_feasibility.py

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists labels May 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #19553. Same fix: pass custom_providers to compression feasibility check. Multiple competing PRs exist (#19553, #20724, #21953, #23563, #23789).

@teknium1

Copy link
Copy Markdown
Contributor

This appears to be implemented on current main already by a separate duplicate fix. This is an automated hermes-sweeper review.

Evidence:

  • agent/conversation_compression.py:136-146 now calls get_model_context_length(...) for the auxiliary compression model with custom_providers=agent._custom_providers.
  • The behavior was added by 7becb19ea00c13bdff6f78b71aa3ddfb0bdb5378 (fix(auxiliary): forward custom_providers to compression model context-length detection).
  • git tag --contains 7becb19ea shows the fix is included starting with v2026.5.16.

Thanks for the PR. The duplicate note in the discussion was accurate; the requested custom-provider forwarding path is now present on main.

@teknium1 teknium1 closed this Jun 11, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compression feasibility check ignores custom_providers context_length, causes false 256K warning

3 participants