UAT: agents plan correct positional argument accepts plan_id, but spec signature requires <DECISION_ID> #6328

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

Bug Report

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


Summary

The spec defines agents plan correct as:

agents plan correct --mode (revert|append) (--guidance|-g) iguidance
                   [--dry-run] [--yes|-y] DECISION_ID

The positional argument is DECISION_ID. However, the implementation accepts either a plan_id or a decision_id as the identifier positional argument. When a plan_id is passed, it silently auto-selects the root decision of that plan. This is an undocumented extension that diverges from the spec.


Code Location

/app/src/cleveragents/cli/commands/plan.py, lines 3463–3590:

@app.command("correct")
def correct_decision(
    identifier: Annotated[
        str,
        typer.Argument(
            help="Plan ID (auto-selects root decision) or Decision ID to correct"
        ),   # ← "or Decision ID" not in spec — spec only allows DECISION_ID
    ],
    ...
) -\u003e None:
    ...
    # Resolve identifier: try as plan_id first, then fall back to decision_id
    try:
        service = container.plan_lifecycle_service()
        plan_obj = service.get_plan(identifier)   # silently tries plan_id
        if isinstance(plan_obj, Plan):
            _is_plan = True
    except RNF:
        pass
    
    if _is_plan:
        # auto-selects root decision — no user-visible indication
        ...

Steps to Reproduce

# Non-spec usage (currently silently works by auto-selecting root decision):
agents plan correct \u003cPLAN_ID\u003e --mode revert --guidance "Fix this" --yes

# Spec-required usage (should be the only supported form):
agents plan correct \u003cDECISION_ID\u003e --mode revert --guidance "Fix this" --yes

Expected (per spec)

  • agents plan correct \u003cDECISION_ID\u003e --mode revert --guidance "..." — works
  • agents plan correct \u003cPLAN_ID\u003e --mode revert --guidance "..." — should fail with "not found as a decision" error

Actual

  • Passing a \u003cPLAN_ID\u003e silently works, auto-selecting the root prompt_definition decision
  • No warning or indication that a plan_id was used instead of a decision_id

Impact

  • Users can accidentally correct the root decision when they meant to correct a specific decision
  • Help text documents "Plan ID (auto-selects root decision) or Decision ID" while spec only allows DECISION_ID
  • Scripts targeting specific decisions that erroneously pass a plan_id will silently correct the root decision

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

## Bug Report **Feature Area**: Plan Lifecycle **Spec Reference**: `docs/specification.md` §`agents plan correct` (line 14912–14922) **Instance**: uat-worker-W1-cycle3 --- ### Summary The spec defines `agents plan correct` as: ``` agents plan correct --mode (revert|append) (--guidance|-g) iguidance [--dry-run] [--yes|-y] DECISION_ID ``` The positional argument is `DECISION_ID`. However, the implementation accepts either a plan_id or a decision_id as the `identifier` positional argument. When a plan_id is passed, it silently auto-selects the root decision of that plan. This is an undocumented extension that diverges from the spec. --- ### Code Location `/app/src/cleveragents/cli/commands/plan.py`, lines 3463–3590: ```python @app.command("correct") def correct_decision( identifier: Annotated[ str, typer.Argument( help="Plan ID (auto-selects root decision) or Decision ID to correct" ), # ← "or Decision ID" not in spec — spec only allows DECISION_ID ], ... ) -\u003e None: ... # Resolve identifier: try as plan_id first, then fall back to decision_id try: service = container.plan_lifecycle_service() plan_obj = service.get_plan(identifier) # silently tries plan_id if isinstance(plan_obj, Plan): _is_plan = True except RNF: pass if _is_plan: # auto-selects root decision — no user-visible indication ... ``` --- ### Steps to Reproduce ```bash # Non-spec usage (currently silently works by auto-selecting root decision): agents plan correct \u003cPLAN_ID\u003e --mode revert --guidance "Fix this" --yes # Spec-required usage (should be the only supported form): agents plan correct \u003cDECISION_ID\u003e --mode revert --guidance "Fix this" --yes ``` --- ### Expected (per spec) - `agents plan correct \u003cDECISION_ID\u003e --mode revert --guidance "..."` — works - `agents plan correct \u003cPLAN_ID\u003e --mode revert --guidance "..."` — should fail with "not found as a decision" error ### Actual - Passing a `\u003cPLAN_ID\u003e` silently works, auto-selecting the root `prompt_definition` decision - No warning or indication that a plan_id was used instead of a decision_id --- ### Impact - Users can accidentally correct the root decision when they meant to correct a specific decision - Help text documents "Plan ID (auto-selects root decision) or Decision ID" while spec only allows DECISION_ID - Scripts targeting specific decisions that erroneously pass a plan_id will silently correct the root decision --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 21:39:32 +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#6328
No description provided.