From 6bccd89e9a109078c67c01d948d2ee8001fbd35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Tue, 2 Jun 2026 20:56:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=20agent/deep=5Fassistant.py=20?= =?UTF-8?q?=E6=8A=8A=E4=B8=A4=E4=B8=AA=E8=90=BD=E7=9B=98=20backend=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20virtual=5Fmode=3DTrue=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agent/deep_assistant.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/agent/deep_assistant.py b/agent/deep_assistant.py index 957b0d0..1cf54ad 100644 --- a/agent/deep_assistant.py +++ b/agent/deep_assistant.py @@ -478,13 +478,19 @@ def create_custom_cli_agent( backend = FilesystemBackend(root_dir=workspace_root, virtual_mode=False) # Set up composite backend with routing based on the new implementation + # NOTE: virtual_mode=True anchors all paths to root_dir. This is required for + # these offload-only backends: CompositeBackend strips the route prefix and + # forwards "/" to grep, so virtual_mode=False would resolve "/" to the real + # filesystem root and scan the whole disk (hitting /usr, /var, other sessions' + # temp dirs), causing 45-152s grep calls. virtual_mode=True confines grep to + # the temp dir and filters out-of-root results. large_results_backend = FilesystemBackend( root_dir=tempfile.mkdtemp(prefix="deepagents_large_results_"), - virtual_mode=False, + virtual_mode=True, ) conversation_history_backend = FilesystemBackend( root_dir=tempfile.mkdtemp(prefix="deepagents_conversation_history_"), - virtual_mode=False, + virtual_mode=True, ) composite_backend = CompositeBackend( default=backend,