MCPcopy Index your code
hub / github.com/AI45Lab/Code / inject_continuation_if_needed

Method inject_continuation_if_needed

core/src/agent/completion_runtime.rs:45–68  ·  view source on GitHub ↗
(
        &self,
        state: &mut ExecutionLoopState,
        turn: usize,
        candidate_text: &str,
    )

Source from the content-addressed store, hash-verified

43 }
44
45 fn inject_continuation_if_needed(
46 &self,
47 state: &mut ExecutionLoopState,
48 turn: usize,
49 candidate_text: &str,
50 ) -> bool {
51 if !state.should_inject_continuation(
52 Self::looks_incomplete(candidate_text),
53 self.config.continuation_enabled,
54 self.config.max_continuation_turns,
55 self.config.max_tool_rounds,
56 ) {
57 return false;
58 }
59
60 tracing::info!(
61 turn = turn,
62 continuation = state.continuation_count(),
63 max_continuation = self.config.max_continuation_turns,
64 "Injecting continuation message - response looks incomplete"
65 );
66 state.messages.push(Message::user(CONTINUATION));
67 true
68 }
69
70 fn sanitize_final_text(&self, text: &str) -> String {
71 if let Some(ref sp) = self.config.security_provider {

Callers 1

Calls 1

Tested by

no test coverage detected