Skip to content

Commit 16e7934

Browse files
authored
sandbox exec support detach cmd (#327)
1 parent 68b13ee commit 16e7934

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

lagent/agents/fc_agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ def __init__(
8080
max_turn: Optional[int] = None,
8181
initialize_input: bool = True,
8282
name: Optional[str] = None,
83+
**kwargs
8384
):
84-
super().__init__(name=name)
85+
super().__init__(name=name, **kwargs)
8586
self.policy_agent = create_object(policy_agent)
8687
self.env_agent = create_object(env_agent)
8788
self.compact_agent = create_object(compact_agent)

lagent/serving/sandbox/providers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
),
5656
)
5757

58-
async def execute(self, command: str, cwd: str = "/root", timeout_sec: int = 60) -> dict:
58+
async def execute(self, command: str, cwd: str = "/root", timeout_sec: int = 60, detach: bool=False) -> dict:
5959
"""Execute a bash command inside the sandbox.
6060
6161
Args:
@@ -68,7 +68,7 @@ async def execute(self, command: str, cwd: str = "/root", timeout_sec: int = 60)
6868
"""
6969
resp = await self._client.post(
7070
"/exec",
71-
json={"command": command, "cwd": cwd, "timeout_sec": timeout_sec},
71+
json={"command": command, "cwd": cwd, "timeout_sec": timeout_sec, "detach": detach},
7272
timeout=timeout_sec + 10,
7373
)
7474
resp.raise_for_status()

0 commit comments

Comments
 (0)