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

Function stop_lifecycle_turns

atomic-cli/src/commands/agent/lifecycle.rs:1017–1036  ·  view source on GitHub ↗
(
    dot_dir: &Path,
    lifecycle: &ManagedLifecycle,
    cause: JournalStopCauseWire,
    resumable: bool,
    observed_at: i64,
)

Source from the content-addressed store, hash-verified

1015}
1016
1017fn stop_lifecycle_turns(
1018 dot_dir: &Path,
1019 lifecycle: &ManagedLifecycle,
1020 cause: JournalStopCauseWire,
1021 resumable: bool,
1022 observed_at: i64,
1023) -> CliResult<()> {
1024 let sink = journal_sink(dot_dir)?;
1025 for session in sessions_for_run(dot_dir, &lifecycle.run_id) {
1026 sink.stop_turn(
1027 &session.session_id,
1028 pending_turn_number(&session),
1029 map_stop_cause(cause),
1030 resumable,
1031 observed_at,
1032 )
1033 .map_err(|reason| CliError::Internal(anyhow!(reason)))?;
1034 }
1035 Ok(())
1036}
1037
1038fn resume_lifecycle_turns(dot_dir: &Path, lifecycle: &ManagedLifecycle, now: i64) -> CliResult<()> {
1039 let sink = journal_sink(dot_dir)?;

Callers 1

runMethod · 0.85

Calls 5

journal_sinkFunction · 0.85
sessions_for_runFunction · 0.85
pending_turn_numberFunction · 0.85
map_stop_causeFunction · 0.85
stop_turnMethod · 0.45

Tested by

no test coverage detected