Repository navigation
report unknown keys in config.yaml at startup and in --validate-config - #258
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # docs/content/about/release-notes.md
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #255. Merge that first.
Summary
Reported by @matthewjhunter. A key in the main config that Olla does not read (a typo, or one that was documented but never existed) was dropped silently, which is how the dead keys removed in #255 survived for so long. Loading stays lax so old configs still start.
internal/config/unknown_keys.goaddsFindUnknownKeys, which walks the YAML against theConfigschema and returns each unknown key by full path and line, in document order (for exampleproxy.engnie (line 12)). Free-form maps such asmodel_aliasesand endpointheadersare never reported, top-levelx-keys are skipped for YAML anchors, merge keys terminate, and the report is bounded.config.Loadstores them inConfig.UnknownKeys.main.gologs one WARN line viawarnUnknownKeyslisting all of them, so many typos are one line, not a flood.olla --validate-config(validate.go) lists them under "Ignored keys". They are advisory only: the verdict and exit code are unchanged, so CI that validates shipped-derived configs does not start failing.config.yamlis checked, notmodels.yamlor profiles.Type of change
How was this tested?
New tests in
internal/config/unknown_keys_test.go:TestFindUnknownKeysTestFindUnknownKeys_OrderIsDocumentOrderTestFindUnknownKeys_MergeBombTerminatesTestFindUnknownKeys_ReportsAreBoundedTestLoad_RecordsUnknownKeysAndStillLoadsTestLoad_NoUnknownKeysWhenCleanTestShippedConfigsHaveNoUnknownKeysAnd in
validate_test.go:TestBuildValidationReport_IgnoredKeysListedWithoutChangingVerdictTestBuildValidationReport_IgnoredKeysDoNotMaskRealFailuresTestRunValidateConfig_UnknownKeyReportedAndExitUnchangedTestWarnUnknownKeys_SingleLineListingAllTested together with the other uplift-october branches on a local integration branch at
4990a5d:make readyand betteralign v0.8.2 pass atd188d2e, andgo test -racepasses (security, handlers, router, config).4990a5dis a docs-only reconciliation on top./olla-validate --quick: 50 pass, 0 fail (anthropic 7/7)/claude-code-e2eagainst real Ollama at the shipped default limits: Tier A passes on both the passthrough and translation legs, no 429sper_ip_requests_per_minute: 2, burst 1: Anthropicrate_limit_error429s, each retried after exactlyRetry-After; the task completedX-RateLimit-Remaining: 0. The WARNreasonisGlobal rate limit exceededfor the global tier./olla/anthropic/v1/messagesgives 413request_too_large, with no ERROR line--validate-config: the shipped config passes with no ignored keys; a config with typos lists them with lines and exits 0; one startup WARNChecklist
make readypasses at61b6641docs/content/configuration/reference.md,docs/content/getting-started/installation.md, v0.0.30 release note