Whether a durable session record exists for `session_id` in the canonical session store. Loading never creates state.
(repository_root: &std::path::Path, session_id: &str)
| 706 | /// Whether a durable session record exists for `session_id` in the canonical |
| 707 | /// session store. Loading never creates state. |
| 708 | fn agent_session_exists(repository_root: &std::path::Path, session_id: &str) -> CliResult<bool> { |
| 709 | let store = match atomic_repository::Repository::canonical_dot_dir(repository_root) { |
| 710 | Ok(dot_dir) => atomic_agent::turn::session::SessionStore::new(dot_dir.join("sessions")) |
| 711 | .map_err(|e| CliError::Internal(anyhow!("session store unavailable: {}", e)))?, |
| 712 | Err(_) => atomic_agent::turn::session::SessionStore::for_repo(repository_root) |
| 713 | .map_err(|e| CliError::Internal(anyhow!("session store unavailable: {}", e)))?, |
| 714 | }; |
| 715 | store |
| 716 | .load(session_id) |
| 717 | .map(|loaded| loaded.is_some()) |
| 718 | .map_err(|e| CliError::Internal(anyhow!("cannot load session {}: {}", session_id, e))) |
| 719 | } |
| 720 | |
| 721 | impl Hooks { |
| 722 | fn should_handoff_codex_lifecycle(&self, managed: bool) -> bool { |
no test coverage detected