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

Method with_create_subsession

crates/opencode-tool/src/tool.rs:428–437  ·  view source on GitHub ↗
(mut self, callback: F)

Source from the content-addressed store, hash-verified

426 }
427
428 pub fn with_create_subsession<F, Fut>(mut self, callback: F) -> Self
429 where
430 F: Fn(String, Option<String>, Option<String>, Vec<String>) -> Fut + Send + Sync + 'static,
431 Fut: std::future::Future<Output = Result<String, ToolError>> + Send + 'static,
432 {
433 self.create_subsession = Some(Arc::new(move |agent, title, model, disabled_tools| {
434 Box::pin(callback(agent, title, model, disabled_tools))
435 }));
436 self
437 }
438
439 pub async fn do_create_subsession(
440 &self,

Calls 1

newFunction · 0.85

Tested by

no test coverage detected