Skip to content

Commit 28da7d8

Browse files
committed
Add local sandbox session manager support and config
- Add agent_sdk_use_local_sandbox setting and LocalSandboxSessionManager branch in AgentSessionMixin._ensure_agent_session - Update predicator_v3 config to use docker sandbox by default
1 parent ea139a2 commit 28da7d8

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

predicators/approaches/agent_session_mixin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ def _ensure_agent_session(self) -> None:
109109
image=CFG.agent_sdk_docker_image,
110110
extra_reference_files=self._get_sandbox_reference_files(),
111111
)
112+
elif CFG.agent_sdk_use_local_sandbox:
113+
from predicators.agent_sdk.local_sandbox import \
114+
LocalSandboxSessionManager
115+
self._agent_session = LocalSandboxSessionManager(
116+
system_prompt=self._get_agent_system_prompt(),
117+
log_dir=self._get_log_dir(),
118+
model_name=self._get_agent_model_name(),
119+
tool_context=self._tool_context,
120+
tool_names=tool_names,
121+
extra_reference_files=self._get_sandbox_reference_files(),
122+
)
112123
else:
113124
from claude_agent_sdk import create_sdk_mcp_server
114125

predicators/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,10 @@ class GlobalSettings:
968968
agent_sdk_max_trajectories_in_context = 3
969969
agent_sdk_log_agent_responses = True
970970

971-
# Docker sandbox settings for agent SDK
971+
# Sandbox settings for agent SDK
972972
agent_sdk_use_docker_sandbox = False # run agent inside Docker container
973973
agent_sdk_docker_image = "predicators-sandbox" # Docker image name
974+
agent_sdk_use_local_sandbox = False # sandbox dir with built-in tools, no Docker
974975

975976
# Agent explorer settings
976977
agent_explorer_max_turns = 5 # max agent turns per exploration query

scripts/configs/predicatorv3/predicator_v3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ APPROACHES:
3434
terminate_on_goal_reached_and_option_terminated: True
3535
agent_planner_isolate_test_session: True
3636
agent_sdk_use_docker_sandbox: True
37+
# agent_sdk_use_local_sandbox: True
3738
agent_sdk_max_agent_turns_per_iteration: 40
3839
# mb_agent:
3940
# NAME: "agent_abstraction_learning"

0 commit comments

Comments
 (0)