fix(model): respect explicit context_length override#8590
fix(model): respect explicit context_length override#8590bobashopcashier wants to merge 1 commit into
Conversation
|
CI is currently red, but the failing checks do not appear to be caused by this branch. What failed in Actions:
Local verification on this branch:
Given the shared failure pattern and the fact that this PR is narrowly scoped to the explicit |
|
CI is currently red, but the failing checks do not appear to be caused by this branch.\n\nWhat failed in Actions:\n- : identical Docker build failure seen across the other open PRs from the same batch. The job dies in during
✅ Browser tools ready. Run: python run_agent.py --help added 439 packages, and audited 440 packages in 32s 95 packages are looking for funding 4 vulnerabilities (2 moderate, 2 high) To address all issues, run: Run To see a list of supported npm commands, run: |
|
CI remains red on the same two checks as the other open PRs: I reran the full local suite on this branch with: Result on What looks shared/unrelated to this diff:
Context-length-specific note:
|
|
Additional cross-check: Results:
The failure text is the same |
|
Closing this out — stale after 10 days with no review traction. Bug and fix are still valid on current |
What does this PR do?
This fixes the startup context-length guard so an explicit
model.context_lengthoverride is respected even when it is below the default 64K minimum.The default safety check still applies when no override is configured, and the PR adds constructor-level regression coverage for both paths.
Related Issue
Fixes #8430
Type of Change
Changes Made
run_agent.pyto skip the minimum-context startup rejection whenmodel.context_lengthis explicitly configured.tests/run_agent/test_run_agent.pycovering both the override-allowed and default-rejected constructor paths.How to Test
uv run --extra dev python -m pytest tests/run_agent/test_run_agent.py -q -k "explicit_context_length_override_below_minimum or sub_minimum_context_without_override"uv run --extra dev python -m pytest tests/run_agent/test_switch_model_context.py tests/run_agent/test_compression_feasibility.py -qmodel.context_length: 32768in config and confirm Hermes starts without the minimum context errorChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
uv run --extra dev python -m pytest tests/run_agent/test_run_agent.py -q -k "explicit_context_length_override_below_minimum or sub_minimum_context_without_override"→2 passed, 2 warnings in 5.41suv run --extra dev python -m pytest tests/run_agent/test_switch_model_context.py tests/run_agent/test_compression_feasibility.py -q→14 passed, 14 warnings in 2.14s