codetether_agent/session/tasks/path.rs
1//! Resolve the on-disk path for a session's task log.
2
3use anyhow::Result;
4use std::path::PathBuf;
5
6/// Returns `<sessions_dir>/<id>.tasks.jsonl`.
7///
8/// Mirrors [`crate::session::Session::session_path`] but with the
9/// `.tasks.jsonl` suffix so the log lives alongside its session file.
10pub fn task_log_path(session_id: &str) -> Result<PathBuf> {
11 let dir = crate::config::Config::data_dir()
12 .map(|d| d.join("sessions"))
13 .ok_or_else(|| anyhow::anyhow!("Could not determine data directory"))?;
14 Ok(dir.join(format!("{session_id}.tasks.jsonl")))
15}