Skip to content
10 changes: 10 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,8 @@ pub struct App {
terminal_focused: bool,
pub tool_permissions: crate::tools::ToolPermissions,
pub skills_dirs: Vec<std::path::PathBuf>,
pub plugin_specs: Vec<crate::config::configuration::PluginSpec>,
pub project_root: std::path::PathBuf,
pub is_streaming: bool,
pending_session_title: Option<String>,
session_view_states: std::collections::HashMap<String, ClientSessionState>,
Expand Down Expand Up @@ -1167,6 +1169,8 @@ impl App {
terminal_focused: true,
tool_permissions: crate::tools::ToolPermissions::new(cwd_path.clone()),
skills_dirs: Vec::new(),
plugin_specs: Vec::new(),
project_root: std::path::PathBuf::from("."),
is_streaming: false,
pending_session_title: None,
session_view_states: std::collections::HashMap::new(),
Expand Down Expand Up @@ -1222,6 +1226,8 @@ impl App {
};

let loaded_config = crate::config::ConfigLoader::load()?;
let plugin_specs = loaded_config.merged_config.plugins.clone();
let project_root = loaded_config.project_root.clone();
let mut mcp_config = loaded_config.merged_config.mcp.clone();
crate::remote_mcp::apply_mcp_overrides(&mut mcp_config, prefs_dao.as_ref());
if !mcp_config.is_empty() {
Expand Down Expand Up @@ -1406,6 +1412,8 @@ impl App {
self.custom_instructions = runtime.custom_instructions;
self.tool_permissions = runtime.tool_permissions;
self.skills_dirs = loaded_config.inventory.opencode_skills_dirs;
self.plugin_specs = plugin_specs;
self.project_root = project_root;
self.discovery = runtime.discovery;
self.terminal_title_items = terminal_title_items;
self.startup_hydrated = true;
Expand Down Expand Up @@ -12110,6 +12118,8 @@ mod tests {
terminal_focused: true,
tool_permissions: crate::tools::ToolPermissions::new(".".to_string()),
skills_dirs: Vec::new(),
plugin_specs: Vec::new(),
project_root: std::path::PathBuf::from("."),
is_streaming: false,
pending_session_title: None,
session_view_states: std::collections::HashMap::new(),
Expand Down
5 changes: 3 additions & 2 deletions src/command/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,8 +1265,8 @@ mod tests {
let _ = crate::model::discovery::Discovery::cleanup_test();
let parsed = ParsedCommand {
name: "models".to_string(),
args: vec![],
raw: "/models".to_string(),
args: vec!["ollama".to_string()],
raw: "/models ollama".to_string(),
prefs_data: None,
active_model_id: None,
};
Expand Down Expand Up @@ -1369,6 +1369,7 @@ mod tests {

#[tokio::test]
async fn test_handle_refreshmodels() {
let _guard = crate::model::extensions::ollama::test_cache_lock();
let _ = crate::model::discovery::Discovery::cleanup_test();
let parsed = ParsedCommand {
name: "refreshmodels".to_string(),
Expand Down
Loading
Loading