Bug
When a custom provider is created through the UI/CLI, the model name is saved as-is (preserving the original case, e.g. GLM-5.1). However, when goose resolves the model's context_limit at runtime, it performs a strict case-sensitive comparison against GOOSE_MODEL from config.yaml, which is stored in lowercase. This causes the lookup to fail, silently falling back to the default 128_000 context limit.
Root cause
Two locations that disagree on normalization:
-
create_custom_provider / update_custom_provider (declarative_providers.rs) — saves the model name without normalization:
// Line ~217 (create) and ~266 (update)
.map(|name| ModelInfo::new(name, 128000))
-
normalize_model_config (provider_registry.rs) — performs a strict equality check:
if let Some(info) = self.metadata.known_models
.iter()
.find(|m| m.name == model.model_name && m.context_limit > 0)
{
model.context_limit = Some(info.context_limit);
}
model.model_name comes from ModelConfig::new() → GOOSE_MODEL in config.yaml, which is lowercased. But m.name in known_models retains the original case from the JSON config.
Impact
Custom provider models with uppercase letters in their name (e.g. GLM-5.1, Qwen3-Coder-480B) will always use the default 128k context limit, ignoring the context_limit value set in their JSON config file.
Suggested fix
Add case-insensitive comparison in normalize_model_config:
.find(|m| m.name.to_lowercase() == model.model_name.to_lowercase() && m.context_limit > 0)
Or alternatively, normalize the model name to lowercase in create_custom_provider / update_custom_provider when writing the JSON config.
Workaround
Manually edit the custom provider JSON file (~/.config/goose/custom_providers/<provider>.json) to use the exact same case as GOOSE_MODEL in config.yaml (typically lowercase).
Environment
- goose version: 1.31.1
- OS: Debian 12
Bug
When a custom provider is created through the UI/CLI, the model name is saved as-is (preserving the original case, e.g.
GLM-5.1). However, when goose resolves the model'scontext_limitat runtime, it performs a strict case-sensitive comparison againstGOOSE_MODELfromconfig.yaml, which is stored in lowercase. This causes the lookup to fail, silently falling back to the default128_000context limit.Root cause
Two locations that disagree on normalization:
create_custom_provider/update_custom_provider(declarative_providers.rs) — saves the model name without normalization:normalize_model_config(provider_registry.rs) — performs a strict equality check:model.model_namecomes fromModelConfig::new()→GOOSE_MODELinconfig.yaml, which is lowercased. Butm.nameinknown_modelsretains the original case from the JSON config.Impact
Custom provider models with uppercase letters in their name (e.g.
GLM-5.1,Qwen3-Coder-480B) will always use the default 128k context limit, ignoring thecontext_limitvalue set in their JSON config file.Suggested fix
Add case-insensitive comparison in
normalize_model_config:Or alternatively, normalize the model name to lowercase in
create_custom_provider/update_custom_providerwhen writing the JSON config.Workaround
Manually edit the custom provider JSON file (
~/.config/goose/custom_providers/<provider>.json) to use the exact same case asGOOSE_MODELinconfig.yaml(typically lowercase).Environment