MCPcopy Create free account
hub / github.com/AI45Lab/Code / detect_context_perception_intent

Method detect_context_perception_intent

core/src/agent/turn_context.rs:261–268  ·  view source on GitHub ↗

Detect if context perception is needed based on user prompt. Returns `Some(PreContextPerceptionEvent)` if the prompt suggests the model needs workspace knowledge (finding files, understanding code, etc.).

(
        &self,
        prompt: &str,
        session_id: &str,
        workspace: &str,
    )

Source from the content-addressed store, hash-verified

259 /// Returns `Some(PreContextPerceptionEvent)` if the prompt suggests the model
260 /// needs workspace knowledge (finding files, understanding code, etc.).
261 pub fn detect_context_perception_intent(
262 &self,
263 prompt: &str,
264 session_id: &str,
265 workspace: &str,
266 ) -> Option<PreContextPerceptionEvent> {
267 context_perception::detect_local_context_perception_intent(prompt, session_id, workspace)
268 }
269
270 /// Fire PreContextPerception hook and wait for harness decision.
271 async fn fire_pre_context_perception(&self, event: &PreContextPerceptionEvent) -> HookResult {

Callers 1

Tested by

no test coverage detected