UAT: cleveragents-tool-exec binary not defined as entry point — container tool execution always fails at runtime #6133

Open
opened 2026-04-09 15:21:01 +00:00 by HAL9000 · 1 comment
Owner

Summary

ContainerToolExecutor._build_exec_command() builds a devcontainer exec command that calls cleveragents-tool-exec inside the container, but this binary is never registered as an entry point in pyproject.toml. The only registered entry points are cleveragents and agents. Any attempt to execute a tool inside a container will fail with a "command not found" error.

What Was Tested

Code-level analysis of:

  • src/cleveragents/tool/container_executor.py_build_exec_command(), line 456
  • pyproject.toml[project.scripts] section, lines 105-108

Expected Behavior (from spec)

Per docs/adr/ADR-043-devcontainer-integration.md §Container Tool Execution:

When a plan first needs to execute a tool inside the devcontainer, the system triggers the build. Tools execute via devcontainer exec.

The cleveragents-tool-exec binary must be installed inside the container (via pip install cleveragents) and available on the container's PATH for tool execution to work.

Actual Behavior

In container_executor.py line 456:

cmd = [
    devcontainer,
    "exec",
    *target_args,
    "--",
    "sh",
    "-c",
    f"timeout {int(container_timeout)} cleveragents-tool-exec "
    + shlex.quote(tool_name),
]

The command calls cleveragents-tool-exec inside the container. But pyproject.toml only defines:

[project.scripts]
cleveragents = "cleveragents.cli:main"
agents = "cleveragents.cli:main"

There is no cleveragents-tool-exec entry point. When pip install cleveragents is run inside a container, the cleveragents-tool-exec binary is never created. Every container tool execution will fail with:

sh: cleveragents-tool-exec: command not found

Code Location

  • src/cleveragents/tool/container_executor.py, line 456 — references cleveragents-tool-exec
  • pyproject.toml, lines 105-108 — [project.scripts] section missing cleveragents-tool-exec

Impact

  • All container tool execution is broken — every call to ContainerToolExecutor.execute_tool() will fail with a non-zero exit code
  • The container executor will return ToolResult(success=False, error="Container execution failed (exit code 127): sh: cleveragents-tool-exec: command not found")
  • This affects all v3.6.0 container tool execution features

Suggested Fix

Add a cleveragents-tool-exec entry point to pyproject.toml:

[project.scripts]
cleveragents = "cleveragents.cli:main"
agents = "cleveragents.cli:main"
cleveragents-tool-exec = "cleveragents.tool.container_exec_entrypoint:main"

And implement src/cleveragents/tool/container_exec_entrypoint.py that:

  1. Reads tool name from argv
  2. Reads JSON inputs from stdin
  3. Executes the tool via the local ToolRunner
  4. Writes JSON output to stdout

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

## Summary `ContainerToolExecutor._build_exec_command()` builds a `devcontainer exec` command that calls `cleveragents-tool-exec` inside the container, but this binary is **never registered as an entry point** in `pyproject.toml`. The only registered entry points are `cleveragents` and `agents`. Any attempt to execute a tool inside a container will fail with a "command not found" error. ## What Was Tested Code-level analysis of: - `src/cleveragents/tool/container_executor.py` — `_build_exec_command()`, line 456 - `pyproject.toml` — `[project.scripts]` section, lines 105-108 ## Expected Behavior (from spec) Per `docs/adr/ADR-043-devcontainer-integration.md` §Container Tool Execution: > When a plan first needs to execute a tool inside the devcontainer, the system triggers the build. Tools execute via `devcontainer exec`. The `cleveragents-tool-exec` binary must be installed inside the container (via `pip install cleveragents`) and available on the container's PATH for tool execution to work. ## Actual Behavior In `container_executor.py` line 456: ```python cmd = [ devcontainer, "exec", *target_args, "--", "sh", "-c", f"timeout {int(container_timeout)} cleveragents-tool-exec " + shlex.quote(tool_name), ] ``` The command calls `cleveragents-tool-exec` inside the container. But `pyproject.toml` only defines: ```toml [project.scripts] cleveragents = "cleveragents.cli:main" agents = "cleveragents.cli:main" ``` There is no `cleveragents-tool-exec` entry point. When `pip install cleveragents` is run inside a container, the `cleveragents-tool-exec` binary is never created. Every container tool execution will fail with: ``` sh: cleveragents-tool-exec: command not found ``` ## Code Location - `src/cleveragents/tool/container_executor.py`, line 456 — references `cleveragents-tool-exec` - `pyproject.toml`, lines 105-108 — `[project.scripts]` section missing `cleveragents-tool-exec` ## Impact - **All container tool execution is broken** — every call to `ContainerToolExecutor.execute_tool()` will fail with a non-zero exit code - The container executor will return `ToolResult(success=False, error="Container execution failed (exit code 127): sh: cleveragents-tool-exec: command not found")` - This affects all v3.6.0 container tool execution features ## Suggested Fix Add a `cleveragents-tool-exec` entry point to `pyproject.toml`: ```toml [project.scripts] cleveragents = "cleveragents.cli:main" agents = "cleveragents.cli:main" cleveragents-tool-exec = "cleveragents.tool.container_exec_entrypoint:main" ``` And implement `src/cleveragents/tool/container_exec_entrypoint.py` that: 1. Reads tool name from argv 2. Reads JSON inputs from stdin 3. Executes the tool via the local `ToolRunner` 4. Writes JSON output to stdout --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.6.0 milestone 2026-04-09 15:42:46 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Critical — cleveragents-tool-exec binary not defined as an entry point means container tool execution always fails at runtime. This is a blocking defect for the entire container execution feature.
  • Milestone: v3.6.0 — container tool execution is a v3.6.0 deliverable
  • Story Points: 2 — S — adding an entry point to pyproject.toml is a small change, but requires testing the binary invocation path
  • MoSCoW: Must Have — without this entry point, ContainerToolExecutor cannot invoke tools inside containers under any circumstances; the feature is completely broken
  • Parent Epic: #5711 (Plugin Architecture Extensions / container execution for v3.6.0)

Note: This issue is a prerequisite for #6161 (ContainerToolExecutor DI wiring). Both must be resolved for container execution to work.


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

Issue triaged by project owner: - **State**: Verified - **Priority**: Critical — `cleveragents-tool-exec` binary not defined as an entry point means container tool execution **always fails at runtime**. This is a blocking defect for the entire container execution feature. - **Milestone**: v3.6.0 — container tool execution is a v3.6.0 deliverable - **Story Points**: 2 — S — adding an entry point to `pyproject.toml` is a small change, but requires testing the binary invocation path - **MoSCoW**: Must Have — without this entry point, `ContainerToolExecutor` cannot invoke tools inside containers under any circumstances; the feature is completely broken - **Parent Epic**: #5711 (Plugin Architecture Extensions / container execution for v3.6.0) Note: This issue is a prerequisite for #6161 (ContainerToolExecutor DI wiring). Both must be resolved for container execution to work. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: 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.

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