UAT: snapshot sandbox strategy raises NotImplementedError — spec-defined strategy is unimplemented #2486

Closed
opened 2026-04-03 18:38:00 +00:00 by freemo · 1 comment
Owner

Metadata

Commit message: feat(sandbox): implement snapshot sandbox strategy
Branch: feat/sandbox-snapshot-strategy
Parent Epic: #397 (Epic: Server & Autonomy Infrastructure)

Bug Description

The snapshot sandbox strategy is defined in the specification as one of the six built-in sandbox strategies (alongside git_worktree, copy_on_write, transaction_rollback, overlay, and none), but its implementation raises NotImplementedError. Any resource type or tool that specifies checkpoint: "snapshot" (e.g., shell_execute in the spec's tool list) cannot be sandboxed.

Expected Behavior (from spec)

The spec (§ Tool metadata, lines 7119–7120) shows shell_execute with checkpoint: "snapshot", indicating the snapshot strategy is a required built-in. The SandboxStrategyStr type in factory.py includes "snapshot" as a valid value. The strategy should create a point-in-time filesystem snapshot of the resource state, allowing rollback to that snapshot.

Actual Behavior

SandboxFactory.create_sandbox() in src/cleveragents/infrastructure/sandbox/factory.py (lines 130–135) raises NotImplementedError when sandbox_strategy == "snapshot":

if sandbox_strategy == STRATEGY_SNAPSHOT:
    raise NotImplementedError("Snapshot sandbox not yet implemented")

Additionally, "snapshot" is NOT included in _IMPLEMENTED_STRATEGIES (line 47), so SandboxFactory.is_supported("snapshot") returns False.

Code Location

  • src/cleveragents/infrastructure/sandbox/factory.py, lines 47 and 130–135
  • No snapshot.py implementation file exists in src/cleveragents/infrastructure/sandbox/

Impact

  • Any resource type that uses the snapshot strategy cannot be sandboxed
  • shell_execute tool (spec-defined with checkpoint: "snapshot") cannot be safely isolated
  • SandboxFactory.is_supported("snapshot") incorrectly returns False despite "snapshot" being a valid SandboxStrategyStr value

Subtasks

  • Implement SnapshotSandbox class in src/cleveragents/infrastructure/sandbox/snapshot.py
  • The snapshot strategy should: (1) copy the resource directory to a temp location on create(), (2) restore from the snapshot on rollback(), (3) apply changes on commit()
  • Register SnapshotSandbox in SandboxFactory.create_sandbox()
  • Add "snapshot" to _IMPLEMENTED_STRATEGIES
  • Add unit tests (Behave) for SnapshotSandbox

Definition of Done

  • SandboxFactory.create_sandbox(resource_id, path, "snapshot") returns a working SnapshotSandbox instance
  • SandboxFactory.is_supported("snapshot") returns True
  • SnapshotSandbox implements the full Sandbox protocol (create, get_path, commit, rollback, cleanup)
  • Test coverage ≥ 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata **Commit message**: `feat(sandbox): implement snapshot sandbox strategy` **Branch**: `feat/sandbox-snapshot-strategy` **Parent Epic**: #397 (Epic: Server & Autonomy Infrastructure) ## Bug Description The `snapshot` sandbox strategy is defined in the specification as one of the six built-in sandbox strategies (alongside `git_worktree`, `copy_on_write`, `transaction_rollback`, `overlay`, and `none`), but its implementation raises `NotImplementedError`. Any resource type or tool that specifies `checkpoint: "snapshot"` (e.g., `shell_execute` in the spec's tool list) cannot be sandboxed. ## Expected Behavior (from spec) The spec (§ Tool metadata, lines 7119–7120) shows `shell_execute` with `checkpoint: "snapshot"`, indicating the snapshot strategy is a required built-in. The `SandboxStrategyStr` type in `factory.py` includes `"snapshot"` as a valid value. The strategy should create a point-in-time filesystem snapshot of the resource state, allowing rollback to that snapshot. ## Actual Behavior `SandboxFactory.create_sandbox()` in `src/cleveragents/infrastructure/sandbox/factory.py` (lines 130–135) raises `NotImplementedError` when `sandbox_strategy == "snapshot"`: ```python if sandbox_strategy == STRATEGY_SNAPSHOT: raise NotImplementedError("Snapshot sandbox not yet implemented") ``` Additionally, `"snapshot"` is NOT included in `_IMPLEMENTED_STRATEGIES` (line 47), so `SandboxFactory.is_supported("snapshot")` returns `False`. ## Code Location - `src/cleveragents/infrastructure/sandbox/factory.py`, lines 47 and 130–135 - No `snapshot.py` implementation file exists in `src/cleveragents/infrastructure/sandbox/` ## Impact - Any resource type that uses the `snapshot` strategy cannot be sandboxed - `shell_execute` tool (spec-defined with `checkpoint: "snapshot"`) cannot be safely isolated - `SandboxFactory.is_supported("snapshot")` incorrectly returns `False` despite `"snapshot"` being a valid `SandboxStrategyStr` value ## Subtasks - [ ] Implement `SnapshotSandbox` class in `src/cleveragents/infrastructure/sandbox/snapshot.py` - [ ] The snapshot strategy should: (1) copy the resource directory to a temp location on `create()`, (2) restore from the snapshot on `rollback()`, (3) apply changes on `commit()` - [ ] Register `SnapshotSandbox` in `SandboxFactory.create_sandbox()` - [ ] Add `"snapshot"` to `_IMPLEMENTED_STRATEGIES` - [ ] Add unit tests (Behave) for `SnapshotSandbox` ## Definition of Done - `SandboxFactory.create_sandbox(resource_id, path, "snapshot")` returns a working `SnapshotSandbox` instance - `SandboxFactory.is_supported("snapshot")` returns `True` - `SnapshotSandbox` implements the full `Sandbox` protocol (create, get_path, commit, rollback, cleanup) - Test coverage ≥ 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

Closing as duplicate of #2472. Both issues describe the same bug: snapshot sandbox strategy raises NotImplementedError in SandboxFactory. Issue #2472 was filed first and covers the same root cause, code location, and fix.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Closing as duplicate of #2472. Both issues describe the same bug: `snapshot` sandbox strategy raises `NotImplementedError` in `SandboxFactory`. Issue #2472 was filed first and covers the same root cause, code location, and fix. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#2486
No description provided.