fix(mcp): configure mcp_client allowlist on project switch
Previously mcp_client.configure() was only called during ai_client.send() which meant GUI buttons (Slices/Inspect) couldn't access files when project was switched to an external project like gencpp. Now _switch_project reconfigures mcp_client with the new project's root and file_items.
This commit is contained in:
@@ -2347,6 +2347,9 @@ class AppController:
|
||||
self.ai_status = f"failed to load project: {e}"
|
||||
return
|
||||
self._refresh_from_project()
|
||||
import mcp_client
|
||||
file_items_as_dicts = [{"path": f.path if hasattr(f, "path") else str(f)} for f in self.files]
|
||||
mcp_client.configure(file_items_as_dicts, [str(new_root)])
|
||||
self.ai_status = f"switched to: {Path(path).stem}"
|
||||
|
||||
def _refresh_from_project(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user