(store: &SessionStore, session: &AgentSession)
| 390 | } |
| 391 | |
| 392 | fn 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. |
no test coverage detected