UAT: DevcontainerHandler uses SandboxStrategy.NONE but spec requires container_snapshot #4733

Open
opened 2026-04-08 18:12:52 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: Devcontainer integration — sandbox strategy for devcontainer-instance resources
Severity: Medium — sandbox/checkpoint functionality is degraded; container snapshots are not used for devcontainer resources
Source: src/cleveragents/resource/handlers/devcontainer.py lines 151–155


What Was Tested

Code-level analysis of DevcontainerHandler._default_strategy to verify it matches the spec-required sandbox strategy for devcontainer-instance resources.

Expected Behavior (from spec)

The spec (specification.md line 35272) defines the devcontainer-instance resource type as:

sandbox_strategy: "container_snapshot"
# Overrides the parent's sandbox_strategy; devcontainers use container snapshots
# for checkpoint/rollback rather than the generic container strategy.

The spec also states in the resource type table (line 25272):

| devcontainer-instance (inherits container-instance) | DevcontainerHandler | ✓ | ✓ | ✓ | snapshot (inherited) |

And in the resource type table (line 25113):

| devcontainer-instance (inherits container-instance) | snapshot (inherited) | Container commit/checkpoint (inherited) |

ADR-043 (line 84) also specifies:

| Sandbox strategy | snapshot (inherited) |

Actual Behavior (from code)

DevcontainerHandler explicitly sets _default_strategy = SandboxStrategy.NONE:

# devcontainer.py lines 151-155
# F22/F25 fix: SNAPSHOT raises NotImplementedError in SandboxFactory.
# The container IS the sandbox for devcontainer-instance, so NONE is
# semantically correct until a dedicated container-snapshot strategy
# is implemented.
_default_strategy = SandboxStrategy.NONE

The comment acknowledges this is a workaround because SandboxFactory has not yet implemented the snapshot strategy. However, this means:

  1. Devcontainer resources cannot be checkpointed (spec says checkpointable: true)
  2. The container_snapshot sandbox strategy is not implemented
  3. The spec's checkpoint/rollback semantics for devcontainers are not available

Impact

  • agents resource checkpoint on a devcontainer-instance resource will not use container snapshots
  • The spec's checkpointable: true capability for devcontainer-instance is not functional
  • Rollback after failed plan execution inside a devcontainer is not supported
  • The F22/F25 workaround comment suggests this was a known temporary fix that was never followed up

Code Location

# src/cleveragents/resource/handlers/devcontainer.py lines 144-155
class DevcontainerHandler(BaseResourceHandler):
    """Handler for ``devcontainer-instance`` and ``devcontainer-file`` types.
    ...
    F22/F25 fix: uses ``none`` sandbox strategy instead of ``snapshot``
    because the container itself provides isolation and
    ``SandboxFactory`` has not yet implemented the ``snapshot``
    strategy.  ``devcontainer-file`` resources also use ``none``
    (read-only config file).
    """

    # F22/F25 fix: SNAPSHOT raises NotImplementedError in SandboxFactory.
    # The container IS the sandbox for devcontainer-instance, so NONE is
    # semantically correct until a dedicated container-snapshot strategy
    # is implemented.
    _default_strategy = SandboxStrategy.NONE

Suggested Fix

Implement container_snapshot as a SandboxStrategy enum value and corresponding SandboxFactory implementation that uses docker commit (or equivalent) to create container snapshots. Then update DevcontainerHandler._default_strategy = SandboxStrategy.CONTAINER_SNAPSHOT.

The SandboxFactory needs to handle the container_snapshot strategy by:

  1. Running docker commit <container_id> <snapshot_tag> before plan execution
  2. Restoring from the snapshot on rollback

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

## Bug Report **Feature Area:** Devcontainer integration — sandbox strategy for `devcontainer-instance` resources **Severity:** Medium — sandbox/checkpoint functionality is degraded; container snapshots are not used for devcontainer resources **Source:** `src/cleveragents/resource/handlers/devcontainer.py` lines 151–155 --- ## What Was Tested Code-level analysis of `DevcontainerHandler._default_strategy` to verify it matches the spec-required sandbox strategy for `devcontainer-instance` resources. ## Expected Behavior (from spec) The spec (specification.md line 35272) defines the `devcontainer-instance` resource type as: ```yaml sandbox_strategy: "container_snapshot" # Overrides the parent's sandbox_strategy; devcontainers use container snapshots # for checkpoint/rollback rather than the generic container strategy. ``` The spec also states in the resource type table (line 25272): ``` | devcontainer-instance (inherits container-instance) | DevcontainerHandler | ✓ | ✓ | ✓ | snapshot (inherited) | ``` And in the resource type table (line 25113): ``` | devcontainer-instance (inherits container-instance) | snapshot (inherited) | Container commit/checkpoint (inherited) | ``` ADR-043 (line 84) also specifies: ``` | Sandbox strategy | snapshot (inherited) | ``` ## Actual Behavior (from code) `DevcontainerHandler` explicitly sets `_default_strategy = SandboxStrategy.NONE`: ```python # devcontainer.py lines 151-155 # F22/F25 fix: SNAPSHOT raises NotImplementedError in SandboxFactory. # The container IS the sandbox for devcontainer-instance, so NONE is # semantically correct until a dedicated container-snapshot strategy # is implemented. _default_strategy = SandboxStrategy.NONE ``` The comment acknowledges this is a workaround because `SandboxFactory` has not yet implemented the `snapshot` strategy. However, this means: 1. Devcontainer resources cannot be checkpointed (spec says `checkpointable: true`) 2. The `container_snapshot` sandbox strategy is not implemented 3. The spec's checkpoint/rollback semantics for devcontainers are not available ## Impact - `agents resource checkpoint` on a `devcontainer-instance` resource will not use container snapshots - The spec's `checkpointable: true` capability for `devcontainer-instance` is not functional - Rollback after failed plan execution inside a devcontainer is not supported - The F22/F25 workaround comment suggests this was a known temporary fix that was never followed up ## Code Location ```python # src/cleveragents/resource/handlers/devcontainer.py lines 144-155 class DevcontainerHandler(BaseResourceHandler): """Handler for ``devcontainer-instance`` and ``devcontainer-file`` types. ... F22/F25 fix: uses ``none`` sandbox strategy instead of ``snapshot`` because the container itself provides isolation and ``SandboxFactory`` has not yet implemented the ``snapshot`` strategy. ``devcontainer-file`` resources also use ``none`` (read-only config file). """ # F22/F25 fix: SNAPSHOT raises NotImplementedError in SandboxFactory. # The container IS the sandbox for devcontainer-instance, so NONE is # semantically correct until a dedicated container-snapshot strategy # is implemented. _default_strategy = SandboxStrategy.NONE ``` ## Suggested Fix Implement `container_snapshot` as a `SandboxStrategy` enum value and corresponding `SandboxFactory` implementation that uses `docker commit` (or equivalent) to create container snapshots. Then update `DevcontainerHandler._default_strategy = SandboxStrategy.CONTAINER_SNAPSHOT`. The `SandboxFactory` needs to handle the `container_snapshot` strategy by: 1. Running `docker commit <container_id> <snapshot_tag>` before plan execution 2. Restoring from the snapshot on rollback --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — spec compliance bug identified by UAT testing
  • Story Points: 3 (M) — targeted fix to align implementation with spec
  • MoSCoW: Must Have — spec compliance is required for correct system behavior

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — spec compliance bug identified by UAT testing - **Story Points**: 3 (M) — targeted fix to align implementation with spec - **MoSCoW**: Must Have — spec compliance is required for correct system behavior --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:05:32 +00:00
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#4733
No description provided.