(
session: &AgentSession,
prompt: &str,
history: Option<&[Message]>,
)
| 73 | } |
| 74 | |
| 75 | pub(super) async fn stream( |
| 76 | session: &AgentSession, |
| 77 | prompt: &str, |
| 78 | history: Option<&[Message]>, |
| 79 | ) -> Result<(mpsc::Receiver<AgentEvent>, JoinHandle<()>)> { |
| 80 | bail_if_closed(session)?; |
| 81 | |
| 82 | if let Some(stream) = command_runtime::dispatch_streaming(session, prompt).await { |
| 83 | return Ok(stream); |
| 84 | } |
| 85 | |
| 86 | let input = ConversationInput::from_history(session, history); |
| 87 | let stream_run = StreamRunContext::start(session, prompt, input.persistence).await; |
| 88 | Ok(stream_run.spawn_with_prompt(input.messages, prompt.to_string())) |
| 89 | } |
| 90 | |
| 91 | /// Resume a previously-checkpointed run on this session (P3 cut 2). |
| 92 | /// |
no test coverage detected