(store: Option<&SessionStore>, id: &str)
| 203 | } |
| 204 | |
| 205 | fn runtime_session(store: Option<&SessionStore>, id: &str) -> CliResult<Option<AgentSession>> { |
| 206 | validate_session(id)?; |
| 207 | let session = store |
| 208 | .map(|s| s.load(id)) |
| 209 | .transpose() |
| 210 | .map_err(|e| CliError::Internal(e.into()))? |
| 211 | .flatten(); |
| 212 | if session.as_ref().is_some_and(|s| s.session_id != id) { |
| 213 | return Err(invalid( |
| 214 | "Runtime session identity does not match its filename", |
| 215 | )); |
| 216 | } |
| 217 | Ok(session) |
| 218 | } |
| 219 | |
| 220 | fn intent_key(repo: &Repository, reference: &str) -> CliResult<String> { |
| 221 | if reference.trim() != reference || reference.is_empty() { |
no test coverage detected