[bug] llm-deepseek Config namespace silently reverts to DEFAULT_MODELS (and every other field default) when one required sibling field (thinking/reasoningEffort) is missing #5761
Replies: 1 comment
|
I can confirm the source and, importantly, separate two distinct failure surfaces in The schema. export const Config: z<Config> = z.object({
...
baseURL: z.string(), // required, no default
thinking: z.union(['enabled', 'disabled']), // required, no default
reasoningEffort: z.union(['off', 'low', 'high', 'max']),// required, no default
...
models: z.array(catalogModel).default(DEFAULT_MODELS), // has a default
...
});
Failure surface (a) — your symptom: the silent revert. When the section fails schema validation, the namespace resolves to Failure surface (b) — the "last good config" path. } catch (error) {
if (lastGood === undefined) throw error
lastRaw = raw
ctx.logger.error('llm-deepseek: keeping the last good configuration after an invalid settings section')
ctx.logger.error(error)
return lastGood
}This branch only handles a live settings snapshot that passes the schema but violates a beyond-schema bound (e.g. Why adding
Your ask is right and is the real fix. A cordis-config namespace silently collapsing to schema defaults on a single missing required sibling is a validation-surface gap, not an adapter bug. The highest-value change is to surface a namespace-validation failure visibly: emit a warning in Confirmed: this is the same "section is |
Uh oh!
There was an error while loading. Please reload this page.
llm-deepseek'sConfigschema (dsh-llm-deepseek@0.1.2-rc.1) has three fields with no.default():baseURL,thinking, andreasoningEffortare required with no default. Oursettings.yamlhadbaseURLunderllm-deepseek:(needed for a local Ollama endpoint) but never hadthinking:, and hadreasoningEffortmisplaced one level up underagent-default-model:instead of insidellm-deepseek:.Observed symptom: every field in the
llm-deepseeksection silently fell back to its own.default()— includingmodels, which fell back to the vendor's hardcodedDEFAULT_MODELSarray (three cloud DeepSeek models) instead of the ~17-model local Ollama catalog we had configured.baseURL"worked" anyway only by coincidence, because we also export$DEEPSEEK_BASE_URLand that env var is honored as a separate fallback. Nothing in the terminal output, the browser, or the session log indicated the section had been rejected — we only found it by diffingdsh-llm-deepseek/lib/index.js's hardcoded array against the model picker's actual contents and reading the Zod schema by hand. A same-day-earlier code comment we found in the same file (aboutstreamIdleTimeoutMs) shows someone had hit the identicalconfig === void 0symptom before and patched around it by changing that one field's factory default, without isolating that the real cause was the whole section failing as one object.What we tried, and a loose end: adding
thinking: enabledandreasoningEffort: highdirectly underllm-deepseek:did not fix it for us — after the change and a fulldsh webrestart, the catalog still fell back toDEFAULT_MODELS(confirmed by watching it change to the three stock cloud models, then reverting our patch on the array to check, then restoring). We didn't get time tonight to determine whether that's a 4th missing/mistyped field, or whether an invalid section's "last known good value" (perdsh-settings' publish/degrade behavior, mentioned in #2852) gets cached somewhere and stays stuck even after the YAML is corrected. If anyone recognizes which it is, we'd like to know — happy to test further either way.Ask: could this namespace either get real defaults for
thinking/reasoningEffort(matching whateverdshassumes when talking to a non-DeepSeek-official endpoint), or — more generally — could a namespace validation failure surface somewhere visible (terminal log, a Settings-page banner, anything) instead of silently reverting the whole section to its schema defaults? A cordis-config namespace that'svoid 0because of one missing required sibling field is very easy to mistake for "this key doesn't exist at all," which cost us a few hours before we found it by reading the vendor source directly.Repro: point
llm-deepseek.baseURLat a local Ollama endpoint, add amodels:catalog under the samellm-deepseek:key, omitthinking:, bootdsh web, open the model picker.All reactions