fix(agent): provide current workspace access before model requests

This commit is contained in:
Xubin Ren committed 2026-10-11 17:06:39 +08:00
1 parent d7d4b97df3
commit 1d69f630d7
17 files changed
+265 -44

No files matched your search

+3 -2
View File
@@ -348,10 +348,11 @@ def current_tool_workspace(
*,
restrict_to_workspace: bool = False,
sandbox_restricts_workspace: bool = False,
scope: WorkspaceScope | None = None,
) -> ToolWorkspace:
"""Return the workspace/access policy for the current tool call."""
"""Resolve tool policy from an explicit request scope or the bound call scope."""
scope = current_workspace_scope()
scope = scope if scope is not None else current_workspace_scope()
project_path = (
scope.project_path
if scope is not None