tsk/agent/
no_op.rs

1use super::{Agent, LogProcessor};
2use crate::context::file_system::FileSystemOperations;
3use async_trait::async_trait;
4use std::sync::Arc;
5
6/// A no-op agent that simply outputs the instructions file.
7///
8/// This agent is primarily used for debug sessions where we want to show
9/// the instructions but not execute any actual AI agent. It uses `cat`
10/// to display the instructions file and then exits.
11pub struct NoOpAgent;
12
13#[async_trait]
14impl Agent for NoOpAgent {
15    fn build_command(&self, instructions_path: &str) -> Vec<String> {
16        // Simple command to output the instructions and exit
17        vec![
18            "sh".to_string(),
19            "-c".to_string(),
20            format!(
21                "echo '=== Task Instructions ==='; cat '{}'; echo; echo '=== End Instructions ==='",
22                instructions_path
23            ),
24        ]
25    }
26
27    fn volumes(&self) -> Vec<(String, String, String)> {
28        // No special volumes needed
29        vec![]
30    }
31
32    fn environment(&self) -> Vec<(String, String)> {
33        // Minimal environment
34        vec![]
35    }
36
37    fn create_log_processor(
38        &self,
39        _file_system: Arc<dyn FileSystemOperations>,
40    ) -> Box<dyn LogProcessor> {
41        Box::new(super::no_op_log_processor::NoOpLogProcessor::new())
42    }
43
44    fn name(&self) -> &'static str {
45        "no-op"
46    }
47
48    async fn validate(&self) -> Result<(), String> {
49        // No validation needed for no-op agent
50        Ok(())
51    }
52
53    async fn warmup(&self) -> Result<(), String> {
54        // No warmup needed for no-op agent
55        Ok(())
56    }
57}