UAT: ContainerToolExecutor has no container resource limits (CPU, memory) — spec requires configurable constraints #6122

Open
opened 2026-04-09 15:09:29 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Container Tool Execution — Resource Limits
Severity: Non-critical (backlog)
Found by: UAT Testing (container-tool-execution worker)


What Was Tested

Code-level analysis of ContainerToolExecutor._build_exec_command() and ContainerConfig against the spec's container resource constraint requirements.

Expected Behavior (from spec)

The spec (ADR-039, container-instance resource type) defines that container instances support resource constraints. The ContainerConfig and ContainerToolExecutor should support configuring CPU and memory limits that are passed to the devcontainer exec or underlying Docker/Podman commands. This prevents runaway container processes from consuming all host resources.

Actual Behavior

ContainerConfig has no fields for resource limits:

class ContainerConfig(BaseModel):
    workspace_folder: str = Field(default="/workspace", min_length=1)
    container_id: str = ""
    image: str = ""
    timeout_seconds: int = Field(default=_DEFAULT_TIMEOUT_SECONDS, gt=0)
    host_sandbox_path: str = ""
    # No cpu_limit, memory_limit, or network_mode fields

_build_exec_command() builds the devcontainer exec command without any resource constraint flags. There is no mechanism to pass --memory, --cpus, or --network constraints to the container runtime.

Code Location

  • src/cleveragents/tool/container_executor.pyContainerConfig class (lines 55-82) and _build_exec_command() (lines 430-461)

Expected Fix

Add optional resource limit fields to ContainerConfig:

  • memory_limit: str | None — e.g., "512m", "2g"
  • cpu_limit: float | None — e.g., 0.5 for 50% of one CPU
  • network_mode: str | None — e.g., "none" for network isolation

Pass these as Docker/Podman flags when building the exec command.


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

## Bug Report **Feature Area:** Container Tool Execution — Resource Limits **Severity:** Non-critical (backlog) **Found by:** UAT Testing (container-tool-execution worker) --- ## What Was Tested Code-level analysis of `ContainerToolExecutor._build_exec_command()` and `ContainerConfig` against the spec's container resource constraint requirements. ## Expected Behavior (from spec) The spec (ADR-039, container-instance resource type) defines that container instances support resource constraints. The `ContainerConfig` and `ContainerToolExecutor` should support configuring CPU and memory limits that are passed to the `devcontainer exec` or underlying Docker/Podman commands. This prevents runaway container processes from consuming all host resources. ## Actual Behavior `ContainerConfig` has no fields for resource limits: ```python class ContainerConfig(BaseModel): workspace_folder: str = Field(default="/workspace", min_length=1) container_id: str = "" image: str = "" timeout_seconds: int = Field(default=_DEFAULT_TIMEOUT_SECONDS, gt=0) host_sandbox_path: str = "" # No cpu_limit, memory_limit, or network_mode fields ``` `_build_exec_command()` builds the `devcontainer exec` command without any resource constraint flags. There is no mechanism to pass `--memory`, `--cpus`, or `--network` constraints to the container runtime. ## Code Location - `src/cleveragents/tool/container_executor.py` — `ContainerConfig` class (lines 55-82) and `_build_exec_command()` (lines 430-461) ## Expected Fix Add optional resource limit fields to `ContainerConfig`: - `memory_limit: str | None` — e.g., `"512m"`, `"2g"` - `cpu_limit: float | None` — e.g., `0.5` for 50% of one CPU - `network_mode: str | None` — e.g., `"none"` for network isolation Pass these as Docker/Podman flags when building the exec command. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.6.0 milestone 2026-04-09 21:18:28 +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.

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