fix(agent): honor selected project workspace

This commit is contained in:
Xubin Ren
2026-08-25 02:14:02 +08:00
parent 2ac802b2d5
commit 7fb0811fbb
3 changed files with 61 additions and 0 deletions
+8
View File
@@ -112,6 +112,14 @@ class ContextBuilder:
parts.append(render_template("agent/tool_contract.md"))
project_path = root.expanduser().resolve()
if project_path != self.workspace.expanduser().resolve():
parts.append(
"# Current Project\n\n"
f"Working directory: {project_path}\n"
"Use it as the default root for project files and relative tool paths."
)
if include_memory:
memory = self.memory.read_memory()
if memory and not self._is_template_content(memory, "memory/MEMORY.md"):