Skip to content

feat: keep new Windows local experts on one absolute subtree root - #1386

Open
bobbanga wants to merge 2 commits into
TencentCloud:mainfrom
bobbanga:feat/windows-subtree-root
Open

bobbanga wants to merge 2 commits into
TencentCloud:mainfrom
bobbanga:feat/windows-subtree-root

Conversation

@bobbanga

@bobbanga bobbanga commented Sep 30, 2026 •

Copy link
Copy Markdown

Summary

  • New Windows local_shell / filesystem experts store one fully qualified absolute root_dir, with virtual_mode on and root_semantics=subtree. Relative paths, drive-relative paths, and virtual_mode=False are rejected before any directory is created.
  • Docker, remote storage, and composite stay on the existing create and permission path. They are not stamped, and a missing explicit_virtual_paths field does not block them. Unknown or malformed backend representations are rejected.
  • root_semantics is preserved across ordinary updates. Loading a subtree record fails closed when the installed harness cannot set explicit_virtual_paths.
  • The storage-root picker now follows the host. Windows lists every ready drive (C:/, D:/, ...) as its own collapsed row and preselects the home drive. macOS and Linux keep a single / tree. jail_enforced is true only when bubblewrap is actually available, so Windows and macOS no longer claim an OS sandbox.

Dependency

  • Requires the harness flag added in feat: convert explicit virtual paths for subtree experts octop-harness#30
  • Octop tests imported that harness tree at commit 58cb7b0d044dded11481612de83b972f807f197c (/Users/bob/Code/work/octop-harness/src/octop_harness/__init__.py via PYTHONPATH). They did not import the PyPI octop-harness 1.0.0 wheel.
  • This PR can be reviewed against that commit. A subtree expert cannot run until that harness change is what the process imports.

Test plan

Windows picker, verified on a Windows machine. Opening create-from the general expert shows C:/ selected, with ready drives as collapsed rows (C:, D:, E:, F:, H: on that machine). The hint says file access is limited and there is no OS sandbox.

The two groups below go through AgentManager.create / stamp_new_windows_subtree: supported non-local backends are not cut off, and a local string alias cannot skip the new rule.

PYTHONPATH="/Users/bob/Code/work/octop/src:/Users/bob/Code/work/octop-harness/src" \
  /Users/bob/Code/work/octop/.venv/bin/pytest \
  tests/unit/agents/test_windows_subtree_entry.py::test_create_keeps_supported_non_local_backends \
  tests/unit/agents/test_windows_subtree_entry.py::test_create_composite_keeps_the_existing_scoped_workspace \
  tests/unit/agents/test_windows_subtree_entry.py::test_create_normalizes_string_backend_and_rejects_relative_home \
  tests/unit/agents/test_windows_subtree_entry.py::test_create_rejects_uninterpretable_backend_before_mkdir \
  tests/unit/agents/test_windows_root.py::test_stamp_leaves_supported_non_local_backends_alone \
  tests/unit/agents/test_windows_root.py::test_stamp_normalizes_local_backend_strings \
  -vv --tb=short
============================= test session starts ==============================
platform darwin -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /Users/bob/Code/work/octop/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/bob/Code/work/octop
configfile: pyproject.toml
plugins: cov-7.1.0, anyio-4.14.1, xdist-3.8.0, asyncio-1.4.0, langsmith-0.11.2, testmon-2.2.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collecting ... collected 16 items

tests/unit/agents/test_windows_subtree_entry.py::test_create_keeps_supported_non_local_backends[backend0] PASSED [  6%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_keeps_supported_non_local_backends[docker] PASSED [ 12%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_keeps_supported_non_local_backends[backend2] PASSED [ 18%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_keeps_supported_non_local_backends[backend3] PASSED [ 25%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_composite_keeps_the_existing_scoped_workspace PASSED [ 31%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_normalizes_string_backend_and_rejects_relative_home PASSED [ 37%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_rejects_uninterpretable_backend_before_mkdir[nope] PASSED [ 43%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_rejects_uninterpretable_backend_before_mkdir[backend1] PASSED [ 50%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_rejects_uninterpretable_backend_before_mkdir[backend2] PASSED [ 56%]
tests/unit/agents/test_windows_subtree_entry.py::test_create_rejects_uninterpretable_backend_before_mkdir[backend3] PASSED [ 62%]
tests/unit/agents/test_windows_root.py::test_stamp_leaves_supported_non_local_backends_alone[docker] PASSED [ 68%]
tests/unit/agents/test_windows_root.py::test_stamp_leaves_supported_non_local_backends_alone[backend1] PASSED [ 75%]
tests/unit/agents/test_windows_root.py::test_stamp_leaves_supported_non_local_backends_alone[backend2] PASSED [ 81%]
tests/unit/agents/test_windows_root.py::test_stamp_leaves_supported_non_local_backends_alone[backend3] PASSED [ 87%]
tests/unit/agents/test_windows_root.py::test_stamp_leaves_supported_non_local_backends_alone[opensandbox] PASSED [ 93%]
tests/unit/agents/test_windows_root.py::test_stamp_normalizes_local_backend_strings PASSED [100%]

============================== 16 passed in 1.37s ==============================

Made with Cursor

Stamp only local_shell and filesystem creates. Docker, remote storage,
and composite keep the existing create path and are not given subtree
semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
The storage-root picker opens on the home drive and shows every ready volume as its own collapsed row. macOS and Linux keep a single / tree. The hint reports an OS sandbox only when bubblewrap is actually enforcing one.

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants