Default sandbox exec commands to Bash (#764)

Co-authored-by: Ahmed Allam <ahmed39652003@gmail.com>
This commit is contained in:
alex s
2026-07-14 03:44:05 -07:00
committed by GitHub
co-authored by Ahmed Allam
parent 81a8b2139b
commit e69c8f6633
2 changed files with 58 additions and 0 deletions
+7
View File
@@ -209,6 +209,13 @@ def _wrap_exec_command(tool: FunctionTool) -> FunctionTool:
invoke_tool = tool.on_invoke_tool
async def invoke(ctx: Any, raw_input: str) -> Any:
try:
parsed = json.loads(raw_input)
except (json.JSONDecodeError, TypeError):
parsed = None
if isinstance(parsed, dict) and "shell" not in parsed:
parsed["shell"] = "bash"
raw_input = json.dumps(parsed)
try:
return await invoke_tool(ctx, raw_input)
except ValidationError as exc: