continue-custom/core/config/yaml
Dallin Romney d6259a7304
fix: respect contextLength from YAML model config (#11807)
* fix: respect contextLength from YAML model config

Three fixes for contextLength not being respected:

1. Add contextLength to YAML model schema at the model level (not just
   inside defaultCompletionOptions), matching JSON config behavior
2. Read contextLength from both model-level and defaultCompletionOptions,
   with model-level taking precedence
3. Fix GUI selector fallback using DEFAULT_MAX_TOKENS (4096) instead of
   DEFAULT_CONTEXT_LENGTH (32768)

Closes #4638
Closes #4304

* fix: reduce complexity in modelConfigToBaseLLM

Replace find callbacks with includes() to offset complexity from
contextLength nullish coalescing.

* docs: document contextLength at model level in config.yaml reference

* docs: consistently show contextLength in defaultCompletionOptions for YAML

YAML examples use defaultCompletionOptions.contextLength, JSON examples
use model-level contextLength. Also fixes ollama guide using the wrong
key name (completionOptions -> defaultCompletionOptions).

* refactor: extract env options into helper to reduce complexity

Extract the repetitive env-to-options mapping from modelConfigToBaseLLM
into a separate applyEnvOptions function, bringing complexity well under
the limit of 36.
2026-03-25 12:26:52 -07:00
..
default.ts Rename "agent" terminology to "config" throughout the codebase (#8229) 2025-10-13 22:25:42 -07:00
loadLocalYamlBlocks.ts fix: rule colocation uri logic (#7164) 2025-08-15 10:00:17 -07:00
loadYaml.ts fix: use config.yaml name for default Local Config profile (#11110) 2026-03-24 13:37:52 -07:00
loadYaml.vitest.ts feat: rebrand assistants as agents (#7227) 2025-08-18 16:25:30 -07:00
LocalPlatformClient.ts fix: errors fetching secrets are nonblocking for local configs 2025-11-19 18:32:29 -08:00
LocalPlatformClient.vitest.ts Merge branch 'main' into pr/5961 2025-08-04 08:40:11 -07:00
models.ts fix: respect contextLength from YAML model config (#11807) 2026-03-25 12:26:52 -07:00
models.vitest.ts fix more lints 2026-01-07 20:40:03 +05:30
yamlToContinueConfig.ts Add apiKey field to mcpServers block schema for Bearer token auth (#8120) 2025-10-08 08:33:30 -07:00