Skip to content

fix(provider_registry): case-insensitive model name lookup for context_limit#8906

Open
bzqzheng wants to merge 1 commit intoaaif-goose:mainfrom
bzqzheng:fix/context-limit-case-sensitivity
Open

fix(provider_registry): case-insensitive model name lookup for context_limit#8906
bzqzheng wants to merge 1 commit intoaaif-goose:mainfrom
bzqzheng:fix/context-limit-case-sensitivity

Conversation

@bzqzheng
Copy link
Copy Markdown
Contributor

Problem

Custom provider model names with case mismatches (e.g. GLM-5.1 in the provider JSON config vs glm-5.1 in GOOSE_MODEL) silently failed the known_models context_limit lookup in normalize_model_config and fell back to the default 128k.

Fixes #8752.

Change

Use eq_ignore_ascii_case instead of strict equality when matching model.model_name against entries in metadata.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

  • Added 3 unit tests covering:
    • Case mismatch (uppercase in registry, lowercase in model config) → context_limit resolved correctly
    • Exact case match → no regression
    • Unknown model → falls back gracefully (context_limit stays None)
  • All 3 tests pass.

Checklist

  • DCO sign-off
  • Tests added
  • No regression for native providers (Anthropic, OpenAI) where case is already lowercase

…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 bzqzheng closed this Apr 29, 2026
@bzqzheng bzqzheng reopened this Apr 29, 2026
@bzqzheng 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Case mismatch in custom provider model name breaks context_limit lookup

1 participant