mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 06:53:14 +00:00
* feat: publish plans from sandbox files Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com> * fix: avoid fixed plan filenames Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com> * fix: virtualize local sandbox file paths Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com> * fix: preserve plan_file_path across set_plan_status set_plan_status was rewriting the content record with only markdown and status, dropping plan_file_path. After a reject, the owner's dashboard edit would mirror to a different file than the agent's original, and the next save_plan could republish the stale file. Preserve plan_file_path when updating status. --------- Co-authored-by: Ramon Nogueira <270434257+ramon-langchain@users.noreply.github.com> Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
29 lines
931 B
Python
29 lines
931 B
Python
import os
|
|
|
|
from deepagents.backends import LocalShellBackend
|
|
|
|
|
|
def create_local_sandbox(sandbox_id: str | None = None):
|
|
"""Create a local shell sandbox with no isolation.
|
|
|
|
WARNING: This runs commands directly on the host machine with no sandboxing.
|
|
Only use for local development with human-in-the-loop enabled.
|
|
|
|
The root directory defaults to the current working directory and can be
|
|
overridden via the LOCAL_SANDBOX_ROOT_DIR environment variable. It is
|
|
created if it does not already exist.
|
|
|
|
Args:
|
|
sandbox_id: Ignored for local sandboxes; accepted for interface compatibility.
|
|
|
|
Returns:
|
|
LocalShellBackend instance implementing SandboxBackendProtocol.
|
|
"""
|
|
root_dir = os.getenv("LOCAL_SANDBOX_ROOT_DIR", os.getcwd())
|
|
os.makedirs(root_dir, exist_ok=True)
|
|
|
|
return LocalShellBackend(
|
|
root_dir=root_dir,
|
|
virtual_mode=True,
|
|
inherit_env=True,
|
|
)
|