Skip to content

Commit 888958a

Browse files
committed
terminal tool timeout env
1 parent fcaead7 commit 888958a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

aworld/sandbox/tool_servers/terminal/src/terminal.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,14 @@ async def run_code(
182182
if isinstance(output_format, FieldInfo):
183183
output_format = output_format.default
184184

185+
# Timeout: env TERMINAL_TIMEOUT overrides parameter/default when set
186+
env_timeout = os.environ.get("TERMINAL_TIMEOUT")
187+
if env_timeout is not None:
188+
try:
189+
timeout = int(env_timeout)
190+
except ValueError:
191+
pass # keep current timeout if env value is not a valid integer
192+
185193
output_data = ""
186194
command_id = str(uuid.uuid4())
187195
try:

0 commit comments

Comments
 (0)