MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / new

Method new

crates/opencode-agent/src/executor.rs:56–73  ·  view source on GitHub ↗
(
        agent: AgentInfo,
        providers: Arc<ProviderRegistry>,
        tools: Arc<ToolRegistry>,
    )

Source from the content-addressed store, hash-verified

54
55impl AgentExecutor {
56 pub fn new(
57 agent: AgentInfo,
58 providers: Arc<ProviderRegistry>,
59 tools: Arc<ToolRegistry>,
60 ) -> Self {
61 let max_steps = agent.max_steps.unwrap_or(100);
62 let conversation = Conversation::new();
63
64 Self {
65 agent,
66 conversation,
67 providers,
68 tools,
69 disabled_tools: HashSet::new(),
70 subsessions: Arc::new(Mutex::new(HashMap::new())),
71 max_steps,
72 }
73 }
74
75 pub fn with_system_prompt(mut self, prompt: impl Into<String>) -> Self {
76 self.conversation = Conversation::with_system_prompt(prompt);

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected