refactor(backend): alihkan AppConfig ke zesdex-cms JsonAppConfigRepository

Semua pemanggilan AppConfig::load() diganti dengan
JsonAppConfigRepository + AppConfigRepository trait.
Re-export model::app_config dihapus dari model/mod.rs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
asepharyana
2026-07-17 09:08:41 +07:00
co-authored by Claude Sonnet 5
parent 8e6acc30d5
commit dc9fd4dbd1
6 changed files with 14 additions and 10 deletions
@@ -15,6 +15,7 @@ use crate::dto::provider::request::ToolDef;
use crate::tool::{all_tools, tool_defs, tool_is_risky};
use super::context::SubagentContext;
use super::event::SubagentEvent;
use zesdex_cms::domain::repository::AppConfigRepository;
use zesdex_cms::domain::repository::SettingsRepository;
/// Maps a subagent's allowed tool names to concrete Tool trait objects and
@@ -63,7 +64,9 @@ fn resolve_provider_config() -> (String, String, Option<String>, String) {
let settings = zesdex_cms::infrastructure::persistence::settings_repo::JsonSettingsRepository::new()
.load(&store_base_dir)
.unwrap_or_default();
let app_config = crate::model::app_config::AppConfig::load();
let app_config = zesdex_cms::infrastructure::persistence::app_config_repo::JsonAppConfigRepository::new()
.load(&store_base_dir)
.unwrap_or_default();
let mut api_key = settings.api_keys.get(&settings.provider).cloned().unwrap_or_else(|| {
tracing::warn!("[subagent] no API key for provider '{}' in settings, trying env/default", settings.provider);