Resolve the active agent session for the current view. Scans `.atomic/sessions/` for a session whose `view_name` matches the repository's current view. Returns `(session_id, turn_count)` if found.
(repo: &Repository)
| 66 | /// the repository's current view. Returns `(session_id, turn_count)` |
| 67 | /// if found. |
| 68 | fn resolve_active_session(repo: &Repository) -> Option<(String, u32)> { |
| 69 | let sessions_dir = repo.dot_dir().join("sessions"); |
| 70 | let store = SessionStore::new(&sessions_dir).ok()?; |
| 71 | let current_view = repo.current_view(); |
| 72 | let active = store.find_active().ok()?; |
| 73 | active |
| 74 | .into_iter() |
| 75 | .find(|s| s.view_name == current_view) |
| 76 | .map(|s| (s.session_id.clone(), s.turn_count)) |
| 77 | } |
| 78 | |
| 79 | // Intent Subcommands |
| 80 |
no test coverage detected