fix: surface provider-scoped context length in gateway session info#15668
Open
guantik-gm wants to merge 4 commits into
Open
fix: surface provider-scoped context length in gateway session info#15668guantik-gm wants to merge 4 commits into
guantik-gm wants to merge 4 commits into
Conversation
Collaborator
|
I checked the related PRs called out above (#10690, #5096, #8240, #14382). They do appear to be solving the same user-visible bug family: the gateway session-info banner not surfacing the provider-scoped I don't see a reviewer-blocking code issue in this PR from that comment alone, but I do think we should consolidate before merge so we don't land the same fix multiple times with slightly different implementations/tests. |
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.
Summary
GatewayRunner._format_session_info()reuse the provider compatibility layer when top-levelmodel.context_lengthis absentcontext_lengthfromproviders:/custom_providers:in the gateway session-info bannertests/gateway/test_session_info.pyProblem
The gateway
/reset/ session-info banner only read top-levelmodel.context_length, so configs that stored context under provider-scoped per-model entries (for exampleproviders.<name>.models.<model>.context_length) could incorrectly fall back to the default 128K display even though runtime paths already honored the configured value.Test Plan
python -m pytest tests/gateway/test_session_info.py -q11 passedNotes
model.context_length