Skip to content

report unknown keys in config.yaml at startup and in --validate-config - #258

Merged
thushan merged 13 commits into
mainfrom
feature/unknown-config-keys
Oct 29, 2026
Merged

thushan merged 13 commits into
mainfrom
feature/unknown-config-keys

Conversation

@thushan

@thushan thushan commented Oct 28, 2026

Copy link
Copy Markdown
Owner

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.go adds FindUnknownKeys, which walks the YAML against the Config schema and returns each unknown key by full path and line, in document order (for example proxy.engnie (line 12)). Free-form maps such as model_aliases and endpoint headers are never reported, top-level x- keys are skipped for YAML anchors, merge keys terminate, and the report is bounded.
  • config.Load stores them in Config.UnknownKeys. main.go logs one WARN line via warnUnknownKeys listing 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.
  • Only config.yaml is checked, not models.yaml or profiles.

Type of change

  • New feature
  • Documentation

How was this tested?

New tests in internal/config/unknown_keys_test.go:

  • TestFindUnknownKeys
  • TestFindUnknownKeys_OrderIsDocumentOrder
  • TestFindUnknownKeys_MergeBombTerminates
  • TestFindUnknownKeys_ReportsAreBounded
  • TestLoad_RecordsUnknownKeysAndStillLoads
  • TestLoad_NoUnknownKeysWhenClean
  • TestShippedConfigsHaveNoUnknownKeys

And in validate_test.go:

  • TestBuildValidationReport_IgnoredKeysListedWithoutChangingVerdict
  • TestBuildValidationReport_IgnoredKeysDoNotMaskRealFailures
  • TestRunValidateConfig_UnknownKeyReportedAndExitUnchanged
  • TestWarnUnknownKeys_SingleLineListingAll

Tested together with the other uplift-october branches on a local integration branch at 4990a5d:

  • make ready and betteralign v0.8.2 pass at d188d2e, and go test -race passes (security, handlers, router, config). 4990a5d is a docs-only reconciliation on top.
  • /olla-validate --quick: 50 pass, 0 fail (anthropic 7/7)
  • /claude-code-e2e against real Ollama at the shipped default limits: Tier A passes on both the passthrough and translation legs, no 429s
  • Real Claude Code against per_ip_requests_per_minute: 2, burst 1: Anthropic rate_limit_error 429s, each retried after exactly Retry-After; the task completed
  • Tier checks on both engines (40 requests each): global 60 / per-IP 0 gives 10 passed and 30 429s; global 0 / per-IP 60 gives the same; both 0 gives no 429s. Every 429 has X-RateLimit-Remaining: 0. The WARN reason is Global rate limit exceeded for the global tier.
  • Fairness: a 2/s client was never starved (38/38 and 40/40) while another client hammered
  • An oversized chunked body to /olla/anthropic/v1/messages gives 413 request_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 WARN
  • OpenAI surface (chat stream and non-stream, models, embeddings) 200. Log scan: no panics, races or unexpected ERROR lines.

Checklist

  • make ready passes at 61b6641
  • Tests added or updated for the change
  • Documentation updated: docs/content/configuration/reference.md, docs/content/getting-started/installation.md, v0.0.30 release note
  • No new dependencies added

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 977112b and 66aa25a.

Files selected for processing: 10
  • docs/content/about/release-notes.md
  • docs/content/configuration/reference.md
  • docs/content/getting-started/installation.md
  • internal/config/config.go
  • internal/config/types.go
  • internal/config/unknown_keys.go
  • internal/config/unknown_keys_test.go
  • main.go
  • validate.go
  • validate_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	docs/content/about/release-notes.md
@thushan
thushan merged commit 3ee3821 into main Oct 29, 2026
8 checks passed
@thushan
thushan deleted the feature/unknown-config-keys branch October 29, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant