Conversation
|
Likely duplicate of #15844 (merged). |
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.
What does this PR do?
Fixes the CLI
/modelconfirmation display so configured local/custom-provider context lengths are honored consistently. The display resolver now checks explicit config and matchingcustom_providers[].models.<model>.context_lengthoverrides before falling back to provider-aware metadata ormodels.dev.This also threads
custom_providersthrough both CLI confirmation paths: typed/model ...and picker/apply-result.Related open PRs found before submission: #18777 and #18844 cover broader custom-provider context paths; this PR is the narrow CLI confirmation-display patch on current
upstream/main.Related Issue
Fixes #15779
Type of Change
Changes Made
hermes_cli/model_switch.py: giveresolve_display_context_length()explicit config/custom-provider precedence before metadata fallback.cli.py: pass loadedcustom_providersinto direct and picker/modelconfirmation display paths.tests/hermes_cli/test_model_switch_context_display.py: cover config override, matching custom-provider override, non-matching custom-provider fallback, and existing provider-aware behavior.tests/hermes_cli/test_apply_model_switch_result_context.py: cover picker confirmation display with custom-provider context length.How to Test
custom_providers[].models.<model>.context_length./model <name> --provider <provider>and verify the confirmation shows the configured context./modelpicker and verify the same configured context appears.Automated tests run with the repo-required wrapper, not direct
pytest:scripts/run_tests.sh tests/hermes_cli/test_model_switch_context_display.pyscripts/run_tests.sh tests/hermes_cli/test_apply_model_switch_result_context.py tests/hermes_cli/test_model_switch_custom_providers.py tests/run_agent/test_switch_model_context.pyChecklist
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/AFor New Skills
N/A
Screenshots / Logs
Focused test results:
tests/hermes_cli/test_model_switch_context_display.py: 9 passedtests/hermes_cli/test_apply_model_switch_result_context.py tests/hermes_cli/test_model_switch_custom_providers.py tests/run_agent/test_switch_model_context.py: 23 passed