UAT: ToolRunner SPECIFIC mode container routing has unimplemented TODO — named container target ignored #6109

Open
opened 2026-04-09 14:49:21 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Container Tool Execution — Specific Container Routing
Severity: Critical — named container targeting broken
Found by: UAT Testing (container-tool-execution worker)


What Was Tested

Code-level analysis of ToolRunner.execute() in src/cleveragents/tool/runner.py against the spec's environment.specific tool capability.

Expected Behavior (from spec ADR-043 §Tool Execution Environment Compatibility)

Tools can declare environment.specific: <resource-name> to require execution in a specific named container:

capability:
  environment:
    specific: local/dev-container  # A specific container required

When EnvironmentPreferenceMode.SPECIFIC is set, the ToolRunner should route execution to the named container resource, passing pref.target_resource to the ContainerToolExecutor so it can target the correct container.

Actual Behavior

src/cleveragents/tool/runner.py lines 291-303 contain an explicit TODO:

elif pref.mode == EnvironmentPreferenceMode.SPECIFIC:
    # Route to container; the named target_resource identifies
    # which container to use.
    effective_tool_env = "container"
    # TODO: pass pref.target_resource to the resolver /
    # container executor so the specific named resource is
    # selected.  The current resolver and ContainerToolExecutor
    # APIs do not accept a target_resource parameter.
    logger.debug(
        "tool_env_preference.specific_override",
        tool=tool_name,
        target_resource=pref.target_resource,
    )

The target_resource is logged but never passed to the executor. When a tool declares environment.specific: local/api-dev, the system routes to any available container rather than the specified one. If multiple containers are linked to the project, the wrong container may be selected.

Code Location

  • src/cleveragents/tool/runner.py lines 291-303 — TODO comment
  • src/cleveragents/domain/models/core/execution_environment_preference.pyExecutionEnvironmentPreference.target_resource field
  • src/cleveragents/application/services/execution_environment_resolver.py — resolver does not accept target_resource
  • src/cleveragents/tool/container_executor.pyContainerConfig does not accept dynamic resource selection

Impact

Tools that declare environment.specific will silently route to the wrong container. Users relying on per-tool container targeting (e.g., different tools needing different container images) will get incorrect execution environments with no error.


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

## Bug Report **Feature Area:** Container Tool Execution — Specific Container Routing **Severity:** Critical — named container targeting broken **Found by:** UAT Testing (container-tool-execution worker) --- ## What Was Tested Code-level analysis of `ToolRunner.execute()` in `src/cleveragents/tool/runner.py` against the spec's `environment.specific` tool capability. ## Expected Behavior (from spec ADR-043 §Tool Execution Environment Compatibility) Tools can declare `environment.specific: <resource-name>` to require execution in a specific named container: ```yaml capability: environment: specific: local/dev-container # A specific container required ``` When `EnvironmentPreferenceMode.SPECIFIC` is set, the `ToolRunner` should route execution to the named container resource, passing `pref.target_resource` to the `ContainerToolExecutor` so it can target the correct container. ## Actual Behavior `src/cleveragents/tool/runner.py` lines 291-303 contain an explicit TODO: ```python elif pref.mode == EnvironmentPreferenceMode.SPECIFIC: # Route to container; the named target_resource identifies # which container to use. effective_tool_env = "container" # TODO: pass pref.target_resource to the resolver / # container executor so the specific named resource is # selected. The current resolver and ContainerToolExecutor # APIs do not accept a target_resource parameter. logger.debug( "tool_env_preference.specific_override", tool=tool_name, target_resource=pref.target_resource, ) ``` The `target_resource` is logged but **never passed to the executor**. When a tool declares `environment.specific: local/api-dev`, the system routes to _any_ available container rather than the specified one. If multiple containers are linked to the project, the wrong container may be selected. ## Code Location - `src/cleveragents/tool/runner.py` lines 291-303 — TODO comment - `src/cleveragents/domain/models/core/execution_environment_preference.py` — `ExecutionEnvironmentPreference.target_resource` field - `src/cleveragents/application/services/execution_environment_resolver.py` — resolver does not accept `target_resource` - `src/cleveragents/tool/container_executor.py` — `ContainerConfig` does not accept dynamic resource selection ## Impact Tools that declare `environment.specific` will silently route to the wrong container. Users relying on per-tool container targeting (e.g., different tools needing different container images) will get incorrect execution environments with no error. --- **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#6109
No description provided.