MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / create_child

Method create_child

crates/opencode-session/src/session.rs:860–870  ·  view source on GitHub ↗

Create a child session

(&mut self, parent_id: &str)

Source from the content-addressed store, hash-verified

858
859 /// Create a child session
860 pub fn create_child(&mut self, parent_id: &str) -> Option<Session> {
861 let parent = self.sessions.get(parent_id)?;
862 let child = Session::child(parent);
863 let child_id = child.id.clone();
864 self.sessions.insert(child_id, child.clone());
865 self.events.push(SessionEvent::Created {
866 info: child.clone(),
867 });
868 self.publish_session_event(&SESSION_CREATED_EVENT, &child);
869 Some(child)
870 }
871
872 /// Fork a session at a specific message
873 pub fn fork(&mut self, session_id: &str, message_id: Option<&str>) -> Option<Session> {

Callers 2

create_sessionFunction · 0.80
test_session_managerFunction · 0.80

Calls 3

publish_session_eventMethod · 0.80
getMethod · 0.45
cloneMethod · 0.45

Tested by 1

test_session_managerFunction · 0.64