UAT: plan execute output envelope sandbox.strategy is hardcoded to git_worktree with TODO comment — not derived from plan config #5430

Open
opened 2026-04-09 06:39:56 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: Plan Lifecycle Core — agents plan execute --format json
Severity: Priority/Backlog (affects JSON output accuracy, not core functionality)

What Was Tested

Code-level analysis of agents plan execute <plan_id> --format json output envelope against the specification.

Expected Behavior (from spec)

The agents plan execute --format json output should include accurate sandbox information including the actual sandbox strategy used (e.g., git_worktree, container, etc.) derived from the plan's actual sandbox configuration.

Actual Behavior

The _execute_output_dict function at src/cleveragents/cli/commands/plan.py lines 362–383 hardcodes "strategy": "git_worktree" in the sandbox dict with a TODO comment:

# plan.py lines 362-383 — HARDCODED STRATEGY:
if plan.sandbox_refs:
    primary_ref = plan.sandbox_refs[0]
    sandbox = {
        # TODO: derive strategy from plan's actual sandbox configuration
        # once the plan model exposes it; "git_worktree" is the current
        # default strategy used in all local execution environments.
        "strategy": "git_worktree",  # ← HARDCODED
        "path": primary_ref,
        "branch": f"cleveragents/plan-{plan_id[:8]}",
        "status": "active",
    }
else:
    sandbox = {
        # TODO: derive strategy from plan's actual sandbox configuration
        # once the plan model exposes it; "git_worktree" is the current
        # default strategy used in all local execution environments.
        "strategy": "git_worktree",  # ← HARDCODED
        "path": None,
        "branch": f"cleveragents/plan-{plan_id[:8]}",
        "status": "pending",
    }

This means:

  1. Plans using container-based sandboxes will still report "strategy": "git_worktree" in JSON output
  2. The branch field is derived from only the first 8 characters of the plan_id, which may not match the actual branch name

Impact

  • JSON output consumers (scripts, CI/CD pipelines, monitoring tools) will receive incorrect sandbox strategy information
  • Container-based execution environments will be misreported as git_worktree
  • The TODO comment indicates this is a known gap that was never resolved

Code Location

  • Bug: src/cleveragents/cli/commands/plan.py, lines 362–383 (the _execute_output_dict function)
  • Fix: Expose sandbox strategy from the plan model and derive it dynamically in the output dict

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

## Bug Report **Feature Area**: Plan Lifecycle Core — `agents plan execute --format json` **Severity**: Priority/Backlog (affects JSON output accuracy, not core functionality) ## What Was Tested Code-level analysis of `agents plan execute <plan_id> --format json` output envelope against the specification. ## Expected Behavior (from spec) The `agents plan execute --format json` output should include accurate sandbox information including the actual sandbox strategy used (e.g., `git_worktree`, `container`, etc.) derived from the plan's actual sandbox configuration. ## Actual Behavior The `_execute_output_dict` function at `src/cleveragents/cli/commands/plan.py` lines 362–383 hardcodes `"strategy": "git_worktree"` in the sandbox dict with a TODO comment: ```python # plan.py lines 362-383 — HARDCODED STRATEGY: if plan.sandbox_refs: primary_ref = plan.sandbox_refs[0] sandbox = { # TODO: derive strategy from plan's actual sandbox configuration # once the plan model exposes it; "git_worktree" is the current # default strategy used in all local execution environments. "strategy": "git_worktree", # ← HARDCODED "path": primary_ref, "branch": f"cleveragents/plan-{plan_id[:8]}", "status": "active", } else: sandbox = { # TODO: derive strategy from plan's actual sandbox configuration # once the plan model exposes it; "git_worktree" is the current # default strategy used in all local execution environments. "strategy": "git_worktree", # ← HARDCODED "path": None, "branch": f"cleveragents/plan-{plan_id[:8]}", "status": "pending", } ``` This means: 1. Plans using container-based sandboxes will still report `"strategy": "git_worktree"` in JSON output 2. The `branch` field is derived from only the first 8 characters of the plan_id, which may not match the actual branch name ## Impact - JSON output consumers (scripts, CI/CD pipelines, monitoring tools) will receive incorrect sandbox strategy information - Container-based execution environments will be misreported as `git_worktree` - The TODO comment indicates this is a known gap that was never resolved ## Code Location - **Bug**: `src/cleveragents/cli/commands/plan.py`, lines 362–383 (the `_execute_output_dict` function) - **Fix**: Expose sandbox strategy from the plan model and derive it dynamically in the output dict --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 06:49:37 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels to bring issue into compliance with CONTRIBUTING.md

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#5430
No description provided.