pub async fn prepare_task(
task_id: &str,
agent: Option<&str>,
model: Option<&str>,
backend: Option<&dyn ExternalBackend>,
repo: &str,
project_dir: &Path,
attempts: u32,
store: &Option<Arc<TaskStore>>,
) -> Result<TaskInitResult>Expand description
Prepare the full task: set up worktree, build context and prompts, create invocation.