fix(provider_registry): case-insensitive model name lookup for context_limit - #8906
Merged
DOsinga merged 3 commits intoMay 12, 2026
Merged
Conversation
…t_limit Custom provider model names with case mismatches (e.g. 'GLM-5.1' in config vs 'glm-5.1' in GOOSE_MODEL) silently failed the known_models context_limit lookup and fell back to the default 128k. Use eq_ignore_ascii_case instead of strict equality in normalize_model_config so the lookup works regardless of case. Fixes aaif-goose#8752 Signed-off-by: Bright Zheng <bzqzheng@gmail.com>
bzqzheng
marked this pull request as ready for review
April 29, 2026 16:25
Bojun-Vvibe
added a commit
to Bojun-Vvibe/oss-contributions
that referenced
this pull request
Apr 29, 2026
- aaif-goose/goose#8910 (merge-after-nits): cumulative-tokens display fix - aaif-goose/goose#8906 (merge-as-is): case-insensitive provider lookup - INDEX: append drip-179 section, table, and verdict-mix paragraph
added 2 commits
May 12, 2026 14:21
Signed-off-by: Douwe Osinga <douwe@squareup.com>
DOsinga
approved these changes
May 12, 2026
DOsinga
left a comment
Collaborator
There was a problem hiding this comment.
Good fix — the case-insensitive lookup is the right call here.
I removed the tests: they were only asserting that eq_ignore_ascii_case works as documented (exact match still matches, non-match still doesn't). The case-mismatch test was the only one that tested the actual bug, and even that is really just testing a standard library function at this point. The one-liner speaks for itself.
One process note: please don't open multiple PRs at the same time — submit one, wait for it to land, then open the next. See the contributing guide.
shafqatevo
pushed a commit
to shafqatevo/goose
that referenced
this pull request
Aug 7, 2026
…t_limit (aaif-goose#8906) Signed-off-by: Bright Zheng <bzqzheng@gmail.com> Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
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.
Problem
Custom provider model names with case mismatches (e.g.
GLM-5.1in the provider JSON config vsglm-5.1inGOOSE_MODEL) silently failed theknown_modelscontext_limitlookup innormalize_model_configand fell back to the default 128k.Fixes #8752.
Change
Use
eq_ignore_ascii_caseinstead of strict equality when matchingmodel.model_nameagainst entries inmetadata.known_models.This is the smallest possible fix: it only affects the lookup, does not mutate stored model names, and does not change what gets sent to provider APIs.
Verification
Checklist