Skip to content

feat(config): add ValidateConfig trait and per-service validation#1224

Closed
geoffjay wants to merge 2 commits into
issue-1197from
issue-1198-2
Closed

feat(config): add ValidateConfig trait and per-service validation#1224
geoffjay wants to merge 2 commits into
issue-1197from
issue-1198-2

Conversation

@geoffjay
Copy link
Copy Markdown
Owner

feat(config): add ValidateConfig trait and per-service validation

Add a ValidateConfig trait to agentd_common with implementations for all
12 shared config sections. Add AgentdConfig::validate() that collects
errors from every section. Implement ValidateConfig on all service-level
config structs and wire validate() into each service's startup path so
misconfigurations fail early with descriptive error messages.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

fix(config): address review feedback on ValidateConfig PR

  • Add impl ValidateConfig for EmbeddingConfig and LanceConfig in
    crates/memory/src/config.rs (blocking gap: memory was the only service
    with no validation at startup)
  • Wire validation in memory/main.rs: call validate() on embedding and
    lance configs, load shared config for port/host so port=0 is caught
    before any I/O with a clear error message
  • Remove validate_inner() indirection in crates/index/src/config.rs;
    move logic directly into impl ValidateConfig for IndexConfig and
    import the trait in index/main.rs and the test module
  • Make validate_url() pub in agentd-common so service crates can reuse
    it without duplicating the http/https check

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

geoffjay and others added 2 commits May 12, 2026 16:29
Add a ValidateConfig trait to agentd_common with implementations for all
12 shared config sections. Add AgentdConfig::validate() that collects
errors from every section. Implement ValidateConfig on all service-level
config structs and wire validate() into each service's startup path so
misconfigurations fail early with descriptive error messages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add impl ValidateConfig for EmbeddingConfig and LanceConfig in
  crates/memory/src/config.rs (blocking gap: memory was the only service
  with no validation at startup)
- Wire validation in memory/main.rs: call validate() on embedding and
  lance configs, load shared config for port/host so port=0 is caught
  before any I/O with a clear error message
- Remove validate_inner() indirection in crates/index/src/config.rs;
  move logic directly into impl ValidateConfig for IndexConfig and
  import the trait in index/main.rs and the test module
- Make validate_url() pub in agentd-common so service crates can reuse
  it without duplicating the http/https check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@geoffjay
Copy link
Copy Markdown
Owner Author

Duplicate of #1212 — created erroneously by git-spice during restack. Closing in favour of the original PR.

@geoffjay geoffjay closed this May 12, 2026
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