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

Method export_subsessions

crates/opencode-agent/src/executor.rs:117–133  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

115 }
116
117 pub async fn export_subsessions(&self) -> HashMap<String, PersistedSubsessionState> {
118 self.subsessions
119 .lock()
120 .await
121 .iter()
122 .map(|(id, state)| {
123 (
124 id.clone(),
125 PersistedSubsessionState {
126 agent: state.agent.clone(),
127 conversation: state.conversation.clone(),
128 disabled_tools: state.disabled_tools.iter().cloned().collect(),
129 },
130 )
131 })
132 .collect()
133 }
134
135 pub async fn execute(&mut self, user_message: impl Into<String>) -> Result<String, AgentError> {
136 self.conversation.add_user_message(user_message);

Callers 1

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected