Skip to content

[UX]: Add Configuration Validation for Environment Variables #52

@Kavirubc

Description

@Kavirubc

Problem Statement

The configuration loader uses os.ExpandEnv, which silently replaces missing environment variables with empty strings. This leads to cryptic errors from providers (e.g., "API key is empty") rather than a clear diagnostic message about which environment variable is missing.

Proposed Solution

  • Add a Validate() error method to the Config struct in internal/core/config/config.go.
  • Call validation after loading the configuration.
  • Check for required fields like Qdrant.URL, Qdrant.APIKey, and Embedding.APIKey.
  • Provide clear error messages indicating which environment variable or config field is missing.

Metadata

Metadata

Labels

coreRelated to core engineenhancementNew feature or requesthelp wantedExtra attention is neededv0.2.0Target for v0.2.0

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions