codex-memory 0.1.40

An advanced hierarchical memory system for AI agents with MCP integration
Documentation
// Async Harvest Pattern for codex-memory MCP server

// Current implementation (causes timeout):
async fn execute_harvest_conversation(&self, arguments: Value) -> Result<Value> {
    // Long processing...
    let result = self.harvester_service.force_harvest().await?;
    // Returns after full processing
    Ok(json!({"content": format!("Harvested: {}", result)}))
}

// Better implementation (no timeout):
async fn execute_harvest_conversation(&self, arguments: Value) -> Result<Value> {
    // Start harvest in background
    let harvest_id = Uuid::new_v4();
    let harvester = self.harvester_service.clone();
    
    tokio::spawn(async move {
        // Process in background
        harvester.force_harvest().await;
    });
    
    // Return immediately with status
    Ok(json!({
        "content": [{
            "type": "text",
            "text": format!("Harvest started (ID: {})\nUse get_harvest_status to check progress", harvest_id)
        }]
    }))
}

// Add new tool for checking status
async fn execute_get_harvest_status(&self, harvest_id: String) -> Result<Value> {
    let status = self.get_harvest_progress(harvest_id).await?;
    Ok(json!({
        "content": [{
            "type": "text", 
            "text": format!("Progress: {}%\nPatterns found: {}", 
                status.progress, status.patterns_found)
        }]
    }))
}