(
&self,
state: &mut ExecutionLoopState,
turn: usize,
response: &LlmResponse,
effective_prompt: &str,
session_id: Option<&str>,
event_tx: &Optio
| 14 | impl AgentLoop { |
| 15 | #[allow(clippy::too_many_arguments)] |
| 16 | pub(super) async fn complete_no_tool_response( |
| 17 | &self, |
| 18 | state: &mut ExecutionLoopState, |
| 19 | turn: usize, |
| 20 | response: &LlmResponse, |
| 21 | effective_prompt: &str, |
| 22 | session_id: Option<&str>, |
| 23 | event_tx: &Option<mpsc::Sender<AgentEvent>>, |
| 24 | emit_end: bool, |
| 25 | ) -> CompletionFlow { |
| 26 | let candidate_text = response.text(); |
| 27 | |
| 28 | if self.inject_continuation_if_needed(state, turn, &candidate_text) { |
| 29 | return CompletionFlow::Continue; |
| 30 | } |
| 31 | |
| 32 | let final_text = self.sanitize_final_text(&candidate_text); |
| 33 | self.log_execution_completed(state, turn); |
| 34 | self.emit_end_if_requested(state, response, &final_text, event_tx, emit_end) |
| 35 | .await; |
| 36 | |
| 37 | if let Some(sid) = session_id { |
| 38 | self.notify_turn_complete(sid, effective_prompt, &final_text) |
| 39 | .await; |
| 40 | } |
| 41 | |
| 42 | CompletionFlow::Finished(final_text) |
| 43 | } |
| 44 | |
| 45 | fn inject_continuation_if_needed( |
| 46 | &self, |
no test coverage detected