Skip to content

fix(config): validate ov.conf and ovcli.conf strictly#904

Merged
zhoujh01 merged 1 commit intomainfrom
fix/config-validation-errors
Mar 24, 2026
Merged

fix(config): validate ov.conf and ovcli.conf strictly#904
zhoujh01 merged 1 commit intomainfrom
fix/config-validation-errors

Conversation

@qin-ctx
Copy link
Copy Markdown
Collaborator

@qin-ctx qin-ctx commented Mar 23, 2026

Description

Tighten config validation across ov.conf and ovcli.conf so unknown fields fail fast with readable error messages instead of being silently ignored. This also prevalidates the full config during openviking-server --config ... startup and consolidates shared validation/error-formatting helpers into one utility module.

Related Issue

Fixes #855
Related prior PRs: #856, #881

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Added shared config validation helpers for typo suggestions and friendly Pydantic error formatting, and reused them across server, parser, and top-level OpenViking config loaders
  • Made server, parser, top-level ov.conf, and ovcli.conf reject unknown fields with explicit error paths instead of silently ignoring them
  • Validated the full config during openviking-server --config ... startup and added regression tests for friendly error messages and config precedence behavior

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

  • This PR intentionally chooses strict validation for unknown fields, because warning-only behavior still leaves misconfigurations easy to miss.
  • ovcli.conf now also supports filling in missing auth/context fields even when url is passed explicitly, while keeping explicit arguments higher priority than config values.
  • Local verification command:
    env OPENVIKING_CONFIG_FILE=/tmp/codex-no-config.json .venv/bin/python -m pytest tests/client/test_http_client_config.py tests/test_config_loader.py tests/test_server_config_loader.py tests/parse/test_markdown_char_limit.py -q

Reject unknown ov.conf and ovcli.conf fields with friendly suggestions,
and fail fast during server startup instead of silently ignoring typos.

Co-Authored-By: Claude Opus 4.6
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@zhoujh01 zhoujh01 merged commit 7d9075a into main Mar 24, 2026
6 checks passed
@zhoujh01 zhoujh01 deleted the fix/config-validation-errors branch March 24, 2026 03:31
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Config file validation silently ignores unknown fields, causing subtle misconfigurations

2 participants