Skip to content

[Agent] Implement runtime configuration mechanism (CLI args & Env vars) #18

@varev-dev

Description

@varev-dev

Goal

Provide a consistent runtime configuration layer for Volta components (agent, server, CLI) that supports CLI arguments + environment variables with deterministic precedence, validation, and clear startup diagnostics.

Acceptance criteria

  • Runtime options can be configured via both env vars and CLI flags.
  • Precedence works exactly as: flag > env > default for overlapping keys.
  • Invalid runtime input fails fast with clear, actionable error messages.
  • --help output documents all runtime flags; docs include env-var mapping.
  • Unit/integration tests cover: precedence resolution, missing required values by mode, invalid value rejection, successful startup with valid mixed inputs.

Sub-tasks & Scope of work

  • Define Contract: Define a shared configuration contract for runtime options (network bind/port, hub URL/mode selector, log level, config file path override).
  • Implement Loader: Implement source loading from defaults, environment variables (e.g., VOLTA_*), and CLI flags with exact precedence (CLI > env > default).
  • Validation: Add normalization and validation (required fields in centralized mode, valid port ranges, valid URL format, enum constraints like log levels).
  • Diagnostics: Add startup summary logging (safe-by-default; never print secrets in plain text).
  • Documentation: Update command-line parsing, --help text, and README with examples for env-only, CLI-only, and mixed configuration.
  • Testing: Add test suite for config resolution, precedence, and validation errors.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions