[Bug] One malformed entry in provider.<id>.models invalidates the entire provider block
Description
provider.<id>.models entries are validated as one Effect Schema struct over the whole models record. A single malformed entry — e.g. a limit object with output but no context — fails validation for the entire provider block, so every model registered under that provider disappears from the registry, including fully valid entries. Sessions then fail with Model not found: <provider>/<model> even though their individual entries are well-formed.
All-or-nothing validation is very high blast radius for a model list that can hold many entries, especially when entries are written by tooling (see below).
Schema evidence. Verified against the installed 7.7.9 CLI binary (string present in the compiled bundle):
limit:V.Struct({context:V.Finite,input:V.optional(V.Finite),output:V.Finite})
- When a
limitobject is present,limit.contextis required (V.Finite, notV.optional), whilelimit.inputis optional. That asymmetry is easy to trip. - Application granularity (record-level, not per-entry) is established by the observed behavior in the repro below, not by the struct string itself — the string only proves the limit shape.
- The same shape is documented in the public CLI config schema (
"$schema": "https://app.kilo.ai/config.json"inkilo.jsonc); underProviderConfig.models.<id>.limit, bothcontextandoutputare listed asrequiredandinputis unmentioned — so the runtime asymmetry matches the schema, but the required-ness isn't called out anywhere in prose, and nothing documents what happens to the rest of the block when one entry is invalid.
Expected vs actual:
- Expected: the malformed entry (
bad-model) is skipped with a warning naming the entry;good-modeland the rest of the provider's models remain fully usable. - Actual: the whole provider block fails validation; every model on that provider is unresolvable until the config is manually fixed.
Impact. A single bad entry takes down all models on a provider. We hit this in production: two entries written with limit: { output: 8192 } (no context) made every model on the provider fail with Model not found: litellm/<model>, even though every entry those in-flight sessions actually used was valid.
kilo config check is listed in the CLI reference (one line: "check configuration for warnings and errors") and correctly exits nonzero — a usable gate — but its exit-code semantics are not documented, and nothing in the session start-up path surfaces "your provider block was dropped because entry X is malformed" prominently; the first symptom is an opaque Model not found at request time.
Entries may be written by tooling, not only by humans (see below), so a regression in a config generator instantly propagates to every session.
How we hit this. Our model list is generated: model entries are rendered from a local LiteLLM gateway's config by a script. Two entries lacked limit.context. Because validation is all-or-nothing, those two entries killed the entire provider — including the other entries in the same provider.<id> block. A provider block that can hold tens of model entries is exactly the case where one malformed entry should degrade gracefully rather than take down the rest.
Plugins
none
Kilo version
@kilocode/cli7.7.9 (verified). 7.8.1 is current stable at filing time; the 7.8.0/7.8.1 changelogs contain no provider-validation granularity changes. Re-verified on the installed 7.7.9 binary after reading those changelogs — output and registry behavior identical. 7.8.x is not installed in this environment; if maintainers confirm or deny 7.8.x behavior, that would close out the version question.
Steps to reproduce
Config (kilo.jsonc, trimmed — one valid entry + one bad entry):
{
"$schema": "https://app.kilo.ai/config.json",
"provider": {
"litellm": {
"baseUrl": "http://localhost:4000",
"apiKey": "<redacted>",
"models": {
"good-model": { "name": "good-model", "limit": { "context": 128000, "output": 8192 } },
"bad-model": { "name": "bad-model", "limit": { "output": 8192 } }
}
}
}
}
Observed (isolated KILO_CONFIG_DIR, fresh state):
$ kilo config check
/tmp/repro/kilo.jsonc
Configuration is invalid at /tmp/repro/kilo.jsonc: provider.litellm.models.bad-model.limit.context: Missing key
$ echo $?
1
$ kilo models | grep -E 'good-model|bad-model'
(no output — BOTH entries are gone from the registry, including the valid one)
Control: adding "context": 128000 to bad-model's limit makes kilo config check pass and good-model reappear in kilo models — the drop is caused solely by the malformed entry.
The error message correctly names the offending entry and key (provider.litellm.models.bad-model.limit.context: Missing key) — that part is good. But the consequence is that the entire provider.litellm block is rejected: good-model (a perfectly valid entry) is also unresolvable, and any session configured with litellm/good-model (or any other entry in the block) fails with Model not found: litellm/good-model.
Screenshot and/or share link
No response
Operating System
Linux x64
Terminal
n/a (CLI only; Node v24 via nvm)