diff --git a/cuba_cognitive_engine/src/main.rs b/cuba_cognitive_engine/src/main.rs index 27460b9..3569f9d 100644 --- a/cuba_cognitive_engine/src/main.rs +++ b/cuba_cognitive_engine/src/main.rs @@ -17,7 +17,7 @@ async fn main() -> anyhow::Result<()> { // 2. Initialize the MCP Protocol Server // This replaces the entire Python layer. - let mcp_server = std::sync::Arc::new(server::McpServer::new()); + let mcp_server = std::sync::Arc::new(server::McpServer::new()?); // 3. Block on the execution loop mcp_server.run().await?; diff --git a/cuba_cognitive_engine/src/server/mcp_protocol.rs b/cuba_cognitive_engine/src/server/mcp_protocol.rs index 41311c5..49ee288 100644 --- a/cuba_cognitive_engine/src/server/mcp_protocol.rs +++ b/cuba_cognitive_engine/src/server/mcp_protocol.rs @@ -133,16 +133,16 @@ pub struct McpServer { } impl McpServer { - pub fn new() -> Self { + pub fn new() -> Result { // DEBT-T07: Direct sandbox, no router indirection - let sandbox = Arc::new(LocalReasoningEngine::new("cognitive-engine-v3", 2).unwrap()); + let sandbox = Arc::new(LocalReasoningEngine::new("cognitive-engine-v3", 2)?); let sessions = Arc::new(crate::engine::thought_session::SessionStore::new()); let metrics = Arc::new(RedMetrics::new()); - Self { + Ok(Self { sandbox, sessions, metrics, - } + }) } /// Primary Execution Loop (STDIO)