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

Method turn_status

atomic-cli/src/commands/agent/provenance_rpc.rs:912–943  ·  view source on GitHub ↗
(
        &self,
        session_id: &str,
        turn_number: u32,
    )

Source from the content-addressed store, hash-verified

910 }
911
912 fn turn_status(
913 &self,
914 session_id: &str,
915 turn_number: u32,
916 ) -> Result<Option<JournalTurnStatus>, String> {
917 let reference = self.reference.clone();
918 let session_id = session_id.to_string();
919 run_outside_async_runtime(move || {
920 current_thread_runtime()?.block_on(async {
921 let response = request_with_reconnect("turn status", |client| {
922 let reference = reference.clone();
923 let session_id = session_id.clone();
924 async move {
925 provenance_client(client)
926 .get_turn(pb::GetTurnRequest {
927 repository: Some(reference),
928 session_id,
929 turn_number,
930 })
931 .await
932 .map(|response| response.into_inner())
933 }
934 })
935 .await?;
936 match response.turn {
937 None => Ok(None),
938 Some(turn) => Ok(Some(journal_turn_status(&turn)?)),
939 }
940 })
941 })
942 .map_err(|error: anyhow::Error| error.to_string())
943 }
944}
945
946/// The lifecycle transitions: GetTurn first (a lookup never grants a

Callers 2

runMethod · 0.45

Calls 8

current_thread_runtimeFunction · 0.85
request_with_reconnectFunction · 0.85
provenance_clientFunction · 0.85
journal_turn_statusFunction · 0.85
get_turnMethod · 0.80
cloneMethod · 0.45
into_innerMethod · 0.45

Tested by

no test coverage detected