swarm repositories / source
aboutsummaryrefslogtreecommitdiff
path: root/crates/fidget-spinner-cli/src/mcp
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fidget-spinner-cli/src/mcp')
-rw-r--r--crates/fidget-spinner-cli/src/mcp/host/process.rs5
-rw-r--r--crates/fidget-spinner-cli/src/mcp/host/runtime.rs3
2 files changed, 7 insertions, 1 deletions
diff --git a/crates/fidget-spinner-cli/src/mcp/host/process.rs b/crates/fidget-spinner-cli/src/mcp/host/process.rs
index d4cbb4b..fdbd873 100644
--- a/crates/fidget-spinner-cli/src/mcp/host/process.rs
+++ b/crates/fidget-spinner-cli/src/mcp/host/process.rs
@@ -55,6 +55,11 @@ impl WorkerSupervisor {
self.bound_project_root = Some(project_root);
}
+ pub(super) fn refresh_binding(&mut self, project_root: PathBuf) {
+ self.kill_current_worker();
+ self.bound_project_root = Some(project_root);
+ }
+
pub(super) fn execute(
&mut self,
request_id: HostRequestId,
diff --git a/crates/fidget-spinner-cli/src/mcp/host/runtime.rs b/crates/fidget-spinner-cli/src/mcp/host/runtime.rs
index bf0484a..f2f10b7 100644
--- a/crates/fidget-spinner-cli/src/mcp/host/runtime.rs
+++ b/crates/fidget-spinner-cli/src/mcp/host/runtime.rs
@@ -392,7 +392,8 @@ impl HostRuntime {
let args = deserialize::<ProjectBindArgs>(arguments, "tools/call:project.bind")?;
let resolved = resolve_project_binding(PathBuf::from(args.path))
.map_err(host_store_fault("tools/call:project.bind"))?;
- self.worker.rebind(resolved.binding.project_root.clone());
+ self.worker
+ .refresh_binding(resolved.binding.project_root.clone());
self.binding = Some(resolved.binding);
tool_success(
project_bind_output(&resolved.status)?,