Repository navigation
fix(backend): support mkdir/delete/move on OpenSandbox agent workspaces - #1911
Open
JasonBuildAI wants to merge 2 commits into
Open
JasonBuildAI wants to merge 2 commits into
JasonBuildAI wants to merge 2 commits into
Conversation
JasonBuildAI
added a commit
to JasonBuildAI/Octop
that referenced
this pull request
Oct 11, 2026
octop_harness's OpenSandbox implements the deepagents sandbox file surface through execute/upload_files/download_files but, unlike DockerSandbox, never defines mkdir_path / delete_path / move_path. BackendWorkspace requires those primitives on any backend without a host mount, so workspace init on an OpenSandbox backend raises BackendOperationNotSupportedError: mkdir is not supported by backend type 'OpenSandbox' and the expert never starts. Patch the three helpers in place in the Octop backend protocol-compat layer, with the same execute commands docker_sandbox.py uses. The patch skips backends without sandbox_fs, keeps existing implementations, and no-ops once the harness backend defines the primitives itself. Fixes TencentCloud#1813
_LegacyProtocolBackend defines its own no-op mkdir_path for object-store / postgres prefixes, so patching the wrapper would install delete_path and move_path but silently leave mkdir_path a no-op - an asymmetric half-fix for a combination (legacy protocol + sandbox_fs) that no backend implements today. Patch only concrete sandbox backends from the modern-protocol branch.
JasonBuildAI
force-pushed
the
fix/c7d1-work
branch
from
October 15, 2026 17:37
427171b to
0a270dc
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Any expert on an
opensandboxstorage backend currently cannot start:octop_harness'sOpenSandboxsupportsexecute/upload_files/download_files, but unlikeDockerSandboxit never definesmkdir_path/delete_path/move_path, andBackendWorkspacerequires those three primitives on any backend without a host mount. The first workspace mutation therefore raisesBackendOperationNotSupportedError: mkdir is not supported by backend type 'OpenSandbox'and the expert dies during startup. This PR adds the three primitives in Octop's backend protocol-compat layer, so OpenSandbox-backed experts start and workspace seeding / session files work like on the Docker backend.Fixes #1813.
Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Type of change
Test plan
Reproduced first, then fixed (
octop@ this branch,octop_harness1.0.2, Python 3.12.12, Windows 10 zh-CN).OpenSandboxclass + fake remote SDK, no live sandbox. Before the change:The same repro after the change:
uv run pytest tests/unit/backend/test_compat.py -q -k sandbox→2 failed, 3 passedwithout it,21 passedwith it.uv run pytest tests/unit/backend -q→42 passed, 1 skipped.uv run ruff check+uv run ruff format --checkon the two touched files →All checks passed!/2 files already formatted;uv run mypy src/octop→Success: no issues found in 570 source files.uv run pytest -n auto -m "not live"→27 failed, 4430 passed, 201 skipped. All 27 failures are pre-existing environment issues on this box and unrelated to this change: 19 of them (tests callingPath.read_text()without an explicit encoding under a zh-CN Windows GBK locale, intests/unit/dbandtests/unit/backup) pass when the suite is rerun withPYTHONUTF8=1; the remaining 8 are the desktop vendor-wheels shell-script tests, which invokeC:\Windows\System32\bash.EXE(a WSL stub here, not a usable bash). No failing module importsinfra/backend.Notes:
This machine has no
make; the commands above are themake allequivalents (ruff check / ruff format --check / mypy / pytest) run directly.Why fix this in Octop instead of
octop-harness: harness 1.0.2 is already released with the primitives missing, andinfra/backend/compat.pyis the layer Octop already uses to bridge released backends (it adapts the legacydeepagents_backendsprotocol and the S3 listing gap). The patch is idempotent — it skips backends withoutsandbox_fs, keeps any existing implementation, and no-ops as soon as the harness backend defines the three methods — so a future harness/deepagents release that adds them automatically supersedes it. A harness-side fix (or lifting the primitives ontodeepagents'BaseSandbox, as suggested in the issue) is still the better long-term home; this PR unblocks the released versions.make allpasses locally (nomakeon this machine; equivalent commands above)Added/updated tests
Checklist
CHANGELOG.md(if user-facing)AI disclosure: this change was drafted with AI assistance at my request, under my direction and review.