feat(config): implement configuration system #73
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/kronai!73
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/0009-implement-config-system"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implement the KronAI configuration system: schema, loader, merging, and defaults.
Why
Foundation for all job execution - config controls LLM endpoints, job directories, logging, and MCP server definitions.
Testing
Breaking Changes
None.
Notes
Config in TOML format with three search paths: /etc/kronai/config.toml, ~/.config/kronai/config.toml, ./kronai.toml. Job-specific config files supported via parse_job_config().
Closes #0005
Closes #0006
Closes #0007
Closes #0008
Closes #0009
Automated Review — PR #73
Result: APPROVED (no blocking issues found)
Solid implementation. Here's what I checked:
_resolve_config_pathproperly falls through search paths,merge_confighandles dict merging and Path coercion,_parse_tomlwraps errors cleanly inConfigError.ConfigErrorfor invalid TOML and unreadable files. Missing config falls back to defaults.llm_api_keydefaults to empty string, example shows it blank — no secrets in the repo.from __future__ import annotationsfor forward compatibility.Suggestions (non-blocking)
src/kronai/config.py:113— The error message in_parse_tomlincludes the fullpathin the exception string. If the path contains user-home or other sensitive directory info, it could leak in logs. Consider usingpath.nameorpath.resolve()depending on needs.kronai.toml.example— Consider adding a comment thatllm_api_keyshould be set via environment variable in production (e.g.,# In production, prefer KRONAI_LLM_API_KEY env var).src/kronai/config.py:57—merge_configsilently ignores type mismatches (e.g., passing a string fordefault_temperature). Runtime-safe since dataclasses don't enforce types, but adding atry/except TypeErrorwith aConfigErrorwrapping could catch accidental misuse early.