(
session: &AgentSession,
prompt: &str,
history: Option<&[Message]>,
)
| 24 | } |
| 25 | |
| 26 | pub(super) async fn send( |
| 27 | session: &AgentSession, |
| 28 | prompt: &str, |
| 29 | history: Option<&[Message]>, |
| 30 | ) -> Result<AgentResult> { |
| 31 | bail_if_closed(session)?; |
| 32 | |
| 33 | if let Some(result) = command_runtime::dispatch_blocking(session, prompt, history).await? { |
| 34 | return Ok(result); |
| 35 | } |
| 36 | |
| 37 | warn_deferred_init(session); |
| 38 | let input = ConversationInput::from_history(session, history); |
| 39 | let blocking_run = BlockingRunContext::start(session, prompt, input.persistence).await; |
| 40 | blocking_run |
| 41 | .execute_with_prompt(&input.messages, prompt, &session.session_id) |
| 42 | .await |
| 43 | } |
| 44 | |
| 45 | pub(super) async fn send_with_attachments( |
| 46 | session: &AgentSession, |
no test coverage detected