UAT: Container execution environment is stubbed in ToolRunner — lazy devcontainer activation cannot trigger via tool use in production #2139

Open
opened 2026-04-03 04:22:25 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: feat/container-tool-execution-routing
  • Commit Message: feat(tool): implement container execution routing in ToolRunner
  • Milestone: v3.7.0
  • Parent Epic: #398

Bug Report

What Was Tested

The lazy activation of devcontainer resources when a tool executes inside a container execution environment.

Expected Behavior (from spec)

Per docs/specification.md lines 19387-19393 (execution environment routing algorithm):

# Level 3: nearest-ancestor devcontainer
for resource in project.linked_resources (ordered by DAG depth, shallowest first):
    devcontainer = find_child_of_type(resource, "devcontainer-instance")
    if devcontainer:
        if devcontainer.state == "detected":
            build_and_start(devcontainer)   # lazy activation
        return devcontainer

The spec requires that when a tool executes and the execution environment router selects a devcontainer-instance, the container is lazily activated (built and started) on first use. This is the primary trigger for lazy activation in production.

Actual Behavior (from code)

Per docs/reference/devcontainer_resources.md lines 253-254:

| Container execution stubbed (F24) | `ToolRunner` returns an error for `ExecutionEnvironment.CONTAINER`, so lazy activation cannot trigger via tool use in production. Lazy activation currently works through `DevcontainerHandler.resolve()` on plan sandbox resolution. |

The ToolRunner component returns an error when the execution environment is CONTAINER, meaning:

  1. No tool can actually execute inside a container in production
  2. The lazy activation path via tool use is completely non-functional
  3. The 6-level execution environment precedence chain (Level 3) cannot function in production

Root Cause

Container execution support in ToolRunner was deferred. The ToolRunner was not updated to route tool invocations into the selected container execution environment.

Code Location

  • src/cleveragents/tool/: ToolRunner (returns error for ExecutionEnvironment.CONTAINER)
  • src/cleveragents/application/services/execution_environment_resolver.py: Resolver works correctly but results are not acted upon by ToolRunner

Impact

  • No tool can execute inside a devcontainer or container-instance in production
  • The entire container execution environment feature is non-functional end-to-end
  • Plans that require container isolation cannot complete
  • The spec's core capability "A project + resource model for grounding tasks in real codebases" is broken for container-based projects

Severity

High — This is a fundamental gap in the container execution feature. The execution environment routing system is implemented but its output is ignored by the tool runner, making the entire feature non-functional in production.

Subtasks

  • Implement container execution routing in ToolRunner for ExecutionEnvironment.CONTAINER
  • Wire lazy devcontainer activation into the tool execution path
  • Support ExecutionEnvironment.CONTAINER_REF for specific named container resources
  • Add integration test for tool execution inside a devcontainer
  • Add integration test for tool execution inside a container-instance
  • Remove the "Container execution stubbed (F24)" known limitation from docs/reference/devcontainer_resources.md

Definition of Done

  • ToolRunner successfully routes tool invocations to the selected container execution environment
  • Lazy devcontainer activation triggers when a tool first executes in a detected devcontainer
  • Integration tests demonstrate end-to-end tool execution inside a container
  • The associated PR is merged
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `feat/container-tool-execution-routing` - **Commit Message**: `feat(tool): implement container execution routing in ToolRunner` - **Milestone**: v3.7.0 - **Parent Epic**: #398 ## Bug Report ### What Was Tested The lazy activation of devcontainer resources when a tool executes inside a container execution environment. ### Expected Behavior (from spec) Per `docs/specification.md` lines 19387-19393 (execution environment routing algorithm): ``` # Level 3: nearest-ancestor devcontainer for resource in project.linked_resources (ordered by DAG depth, shallowest first): devcontainer = find_child_of_type(resource, "devcontainer-instance") if devcontainer: if devcontainer.state == "detected": build_and_start(devcontainer) # lazy activation return devcontainer ``` The spec requires that when a tool executes and the execution environment router selects a `devcontainer-instance`, the container is lazily activated (built and started) on first use. This is the primary trigger for lazy activation in production. ### Actual Behavior (from code) Per `docs/reference/devcontainer_resources.md` lines 253-254: ``` | Container execution stubbed (F24) | `ToolRunner` returns an error for `ExecutionEnvironment.CONTAINER`, so lazy activation cannot trigger via tool use in production. Lazy activation currently works through `DevcontainerHandler.resolve()` on plan sandbox resolution. | ``` The `ToolRunner` component returns an error when the execution environment is `CONTAINER`, meaning: 1. No tool can actually execute inside a container in production 2. The lazy activation path via tool use is completely non-functional 3. The 6-level execution environment precedence chain (Level 3) cannot function in production ### Root Cause Container execution support in `ToolRunner` was deferred. The `ToolRunner` was not updated to route tool invocations into the selected container execution environment. ### Code Location - `src/cleveragents/tool/`: `ToolRunner` (returns error for `ExecutionEnvironment.CONTAINER`) - `src/cleveragents/application/services/execution_environment_resolver.py`: Resolver works correctly but results are not acted upon by `ToolRunner` ### Impact - No tool can execute inside a devcontainer or container-instance in production - The entire container execution environment feature is non-functional end-to-end - Plans that require container isolation cannot complete - The spec's core capability "A project + resource model for grounding tasks in real codebases" is broken for container-based projects ### Severity **High** — This is a fundamental gap in the container execution feature. The execution environment routing system is implemented but its output is ignored by the tool runner, making the entire feature non-functional in production. ## Subtasks - [ ] Implement container execution routing in `ToolRunner` for `ExecutionEnvironment.CONTAINER` - [ ] Wire lazy devcontainer activation into the tool execution path - [ ] Support `ExecutionEnvironment.CONTAINER_REF` for specific named container resources - [ ] Add integration test for tool execution inside a devcontainer - [ ] Add integration test for tool execution inside a `container-instance` - [ ] Remove the "Container execution stubbed (F24)" known limitation from `docs/reference/devcontainer_resources.md` ## Definition of Done - [ ] `ToolRunner` successfully routes tool invocations to the selected container execution environment - [ ] Lazy devcontainer activation triggers when a tool first executes in a `detected` devcontainer - [ ] Integration tests demonstrate end-to-end tool execution inside a container - [ ] The associated PR is merged - All nox stages pass - Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-03 04:22:29 +00:00
freemo modified the milestone from v3.8.0 to v3.7.0 2026-04-03 04:22:34 +00:00
freemo self-assigned this 2026-04-03 16:58:02 +00:00
Author
Owner

MoSCoW classification: Must Have

Rationale: This issue addresses a core spec requirement or blocks critical functionality. The project cannot ship without this fix.


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

MoSCoW classification: **Must Have** Rationale: This issue addresses a core spec requirement or blocks critical functionality. The project cannot ship without this fix. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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.

Blocks
#398 Epic: Post-MVP Resources
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2139
No description provided.