feat: implement branch-aware context switching and integrate tantivy fuzzy search index

This commit is contained in:
Riz Ashraf committed 2026-09-08 11:44:25 +01:00
1 parent e4ff476b6d
commit 3239e32866
6 files changed
+797 -2

No files matched your search

+10
View File
@@ -175,6 +175,7 @@ impl ServerHandler for MemoryHandler {
entity_type: full_e.entity_type.clone(),
observations: vec![],
namespace: full_e.namespace.clone(),
git_branch: None,
});
e.observations.extend(o.contents);
g.entities.insert(o.entity_name, e);
@@ -463,6 +464,7 @@ impl ServerHandler for MemoryHandler {
description: req.description,
created_at: now,
updated_at: now,
git_branch: req.git_branch,
});
});
Ok(ServerResult::from(CallToolResult::text_content(vec![
@@ -496,8 +498,12 @@ impl ServerHandler for MemoryHandler {
}
}
"list_active_tasks" => {
let req: ListActiveTasksTool = parse_args(args)?;
let mut tasks = self.state.tasks.read();
tasks.retain(|t| t.status != "done");
if let Some(branch) = req.git_branch {
tasks.retain(|t| t.git_branch.is_none() || t.git_branch.as_deref() == Some(branch.as_str()));
}
let data = serde_json::to_string(&tasks).unwrap_or_default();
Ok(ServerResult::from(CallToolResult::text_content(vec![
data.into(),
@@ -710,6 +716,7 @@ impl ServerHandler for MemoryHandler {
.duration_since(UNIX_EPOCH)
.unwrap()
.as_secs(),
git_branch: req.git_branch,
});
});
Ok(ServerResult::from(CallToolResult::text_content(vec![
@@ -732,6 +739,9 @@ impl ServerHandler for MemoryHandler {
if let Some(ns) = req.namespace {
pinned.retain(|p| p.namespace == ns);
}
if let Some(branch) = req.git_branch {
pinned.retain(|p| p.git_branch.is_none() || p.git_branch.as_deref() == Some(branch.as_str()));
}
let data = serde_json::to_string(&pinned).unwrap_or_default();
Ok(ServerResult::from(CallToolResult::text_content(vec![
data.into(),