MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / stop_turn

Method stop_turn

libatomic/src/daemon/journal_sink.rs:275–302  ·  view source on GitHub ↗
(
        &self,
        session_id: &str,
        turn_number: u32,
        cause: JournalStopCause,
        resumable: bool,
        observed_at: i64,
    )

Source from the content-addressed store, hash-verified

273 }
274
275 fn stop_turn(
276 &self,
277 session_id: &str,
278 turn_number: u32,
279 cause: JournalStopCause,
280 resumable: bool,
281 observed_at: i64,
282 ) -> Result<Option<JournalTurnStatus>, String> {
283 let turn = self
284 .store()?
285 .get_provenance_turn_for(session_id, turn_number)
286 .map_err(|error| error.to_string())?;
287 let Some(turn) = turn else { return Ok(None) };
288 let stopped = self
289 .store()?
290 .stop_provenance_turn(
291 turn.provenance_id,
292 turn.generation,
293 StopState {
294 cause: to_store_stop_cause(cause),
295 observed_at,
296 last_event_seq: None,
297 resumable,
298 },
299 )
300 .map_err(|error| error.to_string())?;
301 Ok(Some(to_journal_turn_status(stopped)))
302 }
303
304 fn resume_turn(
305 &self,

Callers

nothing calls this directly

Calls 5

to_store_stop_causeFunction · 0.85
to_journal_turn_statusFunction · 0.85
stop_provenance_turnMethod · 0.80
storeMethod · 0.45

Tested by

no test coverage detected