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

Method set_status

crates/opencode-session/src/todo.rs:109–130  ·  view source on GitHub ↗
(&self, session_id: &str, index: usize, status: &str)

Source from the content-addressed store, hash-verified

107 }
108
109 pub async fn set_status(&self, session_id: &str, index: usize, status: &str) -> bool {
110 let mut state = self.state.write().await;
111 if let Some(todos) = state.get_mut(session_id) {
112 if index < todos.len() {
113 todos[index].status = status.to_string();
114
115 if let Some(ref db) = self.db {
116 let item = opencode_storage::TodoItem {
117 id: format!("{}_{}", session_id, index),
118 content: todos[index].content.clone(),
119 status: status.to_string(),
120 priority: todos[index].priority.clone(),
121 position: index as i64,
122 };
123 let _ = db.upsert(session_id, &item).await;
124 }
125
126 return true;
127 }
128 }
129 false
130 }
131
132 pub async fn add(&self, session_id: &str, todo: TodoInfo) {
133 let mut state = self.state.write().await;

Callers

nothing calls this directly

Calls 3

upsertMethod · 0.80
get_mutMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected