UAT: agents plan prompt restricted to Execute phase only — spec says it should work when plan is errored in any active phase #6340

Open
opened 2026-04-09 20:11:54 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Plan Lifecycle
Spec Reference: docs/specification.md §agents plan prompt (line 15918–15920)
Instance: uat-worker-W1-cycle3


Summary

agents plan prompt is restricted exclusively to the Execute phase in the service implementation. Plans that are in Strategize/errored or other active phases cannot receive user guidance via plan prompt, despite the spec stating it is for "when it is errored or awaiting input" without phase restriction.

Additionally, plan status for an errored plan (in any phase) displays the hint: Recoverable: yes — use "agents plan prompt" to provide guidance (spec line ~14054), but this guidance will fail with a PlanError if the plan is not in the Execute phase.


Code Location

/app/src/cleveragents/application/services/plan_lifecycle_service.py, lines 1937–1949:

allowed_states = {
    ProcessingState.QUEUED,
    ProcessingState.PROCESSING,
    ProcessingState.ERRORED,
}
if (
    plan.phase != PlanPhase.EXECUTE          # ← hard-coded Execute-only restriction
    or plan.processing_state not in allowed_states
):
    raise PlanError(
        f"Plan {plan_id} is not in active execute phase "
        f"(current: {plan.phase.value}/{plan.processing_state.value})"
    )

Also, line 1979 hardcodes:

plan_phase=PlanPhase.EXECUTE,   # ← should be plan.phase (dynamic)

Steps to Reproduce

  1. Create a plan and let it fail during Strategize phase (strategize/errored)
  2. Run: agents plan prompt <PLAN_ID> "Adjust the strategy to use fewer files"
  3. Observe: PlanError: Plan ... is not in active execute phase (current: strategize/errored)

Expected (per spec §agents plan prompt)

plan prompt should accept guidance when the plan is in any active (non-terminal) phase where it is errored or processing, including:

  • strategize/errored
  • strategize/queued (awaiting input)
  • execute/errored
  • execute/processing
  • execute/queued

Actual

Only works for execute/* phase states. Any other phase raises a PlanError.


Impact

  • Users following the plan status hint "use agents plan prompt to provide guidance" will receive an unexpected error when the plan errored during Strategize
  • Strategize-phase failures requiring human guidance cannot be recovered via the documented workflow
  • The plan_phase=PlanPhase.EXECUTE hardcode in record_decision call is also incorrect — it should use plan.phase

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

## Bug Report **Feature Area**: Plan Lifecycle **Spec Reference**: `docs/specification.md` §`agents plan prompt` (line 15918–15920) **Instance**: uat-worker-W1-cycle3 --- ### Summary `agents plan prompt` is restricted exclusively to the Execute phase in the service implementation. Plans that are in **Strategize/errored** or other active phases cannot receive user guidance via `plan prompt`, despite the spec stating it is for "when it is errored or awaiting input" without phase restriction. Additionally, `plan status` for an errored plan (in any phase) displays the hint: `Recoverable: yes — use "agents plan prompt" to provide guidance` (spec line ~14054), but this guidance will fail with a `PlanError` if the plan is not in the Execute phase. --- ### Code Location `/app/src/cleveragents/application/services/plan_lifecycle_service.py`, lines 1937–1949: ```python allowed_states = { ProcessingState.QUEUED, ProcessingState.PROCESSING, ProcessingState.ERRORED, } if ( plan.phase != PlanPhase.EXECUTE # ← hard-coded Execute-only restriction or plan.processing_state not in allowed_states ): raise PlanError( f"Plan {plan_id} is not in active execute phase " f"(current: {plan.phase.value}/{plan.processing_state.value})" ) ``` Also, line 1979 hardcodes: ```python plan_phase=PlanPhase.EXECUTE, # ← should be plan.phase (dynamic) ``` --- ### Steps to Reproduce 1. Create a plan and let it fail during Strategize phase (`strategize/errored`) 2. Run: `agents plan prompt <PLAN_ID> "Adjust the strategy to use fewer files"` 3. Observe: `PlanError: Plan ... is not in active execute phase (current: strategize/errored)` --- ### Expected (per spec §agents plan prompt) `plan prompt` should accept guidance when the plan is in any active (non-terminal) phase where it is errored or processing, including: - `strategize/errored` - `strategize/queued` (awaiting input) - `execute/errored` - `execute/processing` - `execute/queued` ### Actual Only works for `execute/*` phase states. Any other phase raises a `PlanError`. --- ### Impact - Users following the `plan status` hint `"use agents plan prompt to provide guidance"` will receive an unexpected error when the plan errored during Strategize - Strategize-phase failures requiring human guidance cannot be recovered via the documented workflow - The `plan_phase=PlanPhase.EXECUTE` hardcode in `record_decision` call is also incorrect — it should use `plan.phase` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 21:09:36 +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.

Dependencies

No dependencies set.

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