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

Method get_forked_title

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

Get a forked title

(&self)

Source from the content-addressed store, hash-verified

392
393 /// Get a forked title
394 pub fn get_forked_title(&self) -> String {
395 // Simple implementation without regex dependency
396 if self.title.ends_with(")") && self.title.contains(" (fork #") {
397 if let Some(pos) = self.title.rfind(" (fork #") {
398 let base = &self.title[..pos];
399 let num_part = &self.title[pos + 8..self.title.len() - 1];
400 if let Ok(num) = num_part.parse::<u32>() {
401 return format!("{} (fork #{})", base, num + 1);
402 }
403 }
404 }
405 format!("{} (fork #1)", self.title)
406 }
407
408 /// Touch the session (update timestamp)
409 pub fn touch(&mut self) {

Callers 3

forkMethod · 0.80
test_fork_titleFunction · 0.80

Calls 1

containsMethod · 0.80

Tested by 2

test_fork_titleFunction · 0.64