HIGH: Unify the triple configuration system into a single source of truth #33
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Problem
Three independent configuration systems coexist, creating confusion about which is authoritative:
bot/config.py (Pydantic models) — Type-safe, loaded at import time from config.yaml + .env via BaseSettings. Defines nested models: ServicesConfig, CheshireCatConfig, ModelsConfig, DiscordConfig, AutonomousConfig, VoiceConfig, MemoryConfig, ServerConfig, GPUConfig.
bot/globals.py (mutable module-level variables) — Loaded from os.getenv() with fallback defaults. This is the de facto source of truth since nearly all code reads from globals.* directly.
bot/config_manager.py (runtime overrides) — Priority: Runtime > Static > Defaults. Persists changes to config_runtime.yaml. Added for Web UI support.
The Pydantic config models are largely decorative — most code bypasses them entirely and reads globals.* directly. This means:
Proposed Solution
This preserves all three layers but establishes a clear data flow: YAML -> Pydantic -> globals (read-only view).
Impact
Files Affected