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

Function pending_turn

libatomic/src/review/incremental.rs:392–419  ·  view source on GitHub ↗
(store: &SessionStore, session: &AgentSession)

Source from the content-addressed store, hash-verified

390}
391
392fn pending_turn(store: &SessionStore, session: &AgentSession) -> CliResult<Option<TurnInspection>> {
393 if !session.is_turn_active() {
394 return Ok(None);
395 }
396 let number = session
397 .turn_count
398 .checked_add(1)
399 .ok_or_else(|| invalid("Turn overflow"))?;
400 let binding = store
401 .turn_intent_binding(&session.session_id, number)
402 .map_err(|e| CliError::Internal(e.into()))?;
403 Ok(Some(TurnInspection {
404 session_id: session.session_id.clone(),
405 view_name: Some(session.view_name.clone()),
406 turn_number: number,
407 status: "pending_active_unrecorded".into(),
408 session_status: session.status.label().into(),
409 plan_id: binding.map(|b| b.intent_uid).or_else(|| {
410 session
411 .managed_run
412 .as_ref()
413 .and_then(|run| run.work_item_id.clone())
414 }),
415 provenance_hash: None,
416 change_hashes: vec![],
417 outcome: Value::Null,
418 }))
419}
420
421/// Resolve without mutation, network requests, model invocation or approval.
422/// Session context must be supplied explicitly by the invoking client.

Callers 1

resolve_with_sessionFunction · 0.85

Calls 6

is_turn_activeMethod · 0.80
turn_intent_bindingMethod · 0.80
as_refMethod · 0.80
invalidFunction · 0.70
cloneMethod · 0.45
labelMethod · 0.45

Tested by

no test coverage detected