refactor(backend): alihkan Settings ke zesdex-cms JsonSettingsRepository

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 6d41ffc587
commit 8e6acc30d5
9 changed files with 32 additions and 15 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::SettingsRepository;
/// Maps a subagent's allowed tool names to concrete Tool trait objects and
/// OpenAI-style tool definitions.
@@ -58,7 +59,10 @@ fn build_subagent_tools(allowed_tools: &[String]) -> (Vec<Box<dyn crate::tool::T
/// is empty when every resolution path was exhausted — callers must check
/// for this before issuing requests (see `run_subagent`).
fn resolve_provider_config() -> (String, String, Option<String>, String) {
let settings = crate::model::settings::Settings::load();
let store_base_dir = zesdex_entities::seaorm::common::store::Store::new().base_dir;
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 mut api_key = settings.api_keys.get(&settings.provider).cloned().unwrap_or_else(|| {