UAT: RecoveryAction.REVERT_STRATEGIZE serializes as revert_strategize but spec requires revert in plan errors JSON output #4579

Open
opened 2026-04-08 15:49:02 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Error handling and recovery paths
Command: agents plan errors
Severity: High — JSON output field value doesn't match spec, breaking API consumers


Expected Behavior (from spec)

The spec (§ agents plan errors, JSON output, line 15910) shows recovery hint actions as:

{
  "recovery_hints": [
    {
      "action": "retry",
      "message": "Check sandbox permissions and retry execution",
      "cli_command": "agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J"
    },
    {
      "action": "revert",
      "message": "Revert to Strategize phase to adjust the plan",
      "cli_command": "agents plan correct --mode revert -g \"...\" <DECISION_ID>"
    }
  ]
}

The action field for the revert hint should be "revert".

Actual Behavior (from code)

The RecoveryAction enum in src/cleveragents/domain/models/core/error_recovery.py defines:

class RecoveryAction(StrEnum):
    RETRY = "retry"
    REVERT_STRATEGIZE = "revert_strategize"  # ← serializes as "revert_strategize"
    CORRECT = "correct"
    PROMPT = "prompt"
    CANCEL = "cancel"
    MANUAL = "manual"

When the plan errors command outputs recovery hints in JSON format (line 2346 in plan.py):

entry: dict[str, Any] = {
    "action": h.action.value,  # ← outputs "revert_strategize" not "revert"
    "message": h.message,
}

This means the JSON output will contain "action": "revert_strategize" instead of the spec-required "action": "revert".

Impact

  • API consumers parsing the JSON output will receive revert_strategize instead of revert
  • Breaks the spec contract for the plan errors command
  • Any tooling that checks action == "revert" will fail to match

Code Location

  • src/cleveragents/domain/models/core/error_recovery.pyRecoveryAction enum (lines 69–91)
  • src/cleveragents/cli/commands/plan.pyplan_errors handler (lines 2344–2350)

Fix Required

Either:

  1. Rename REVERT_STRATEGIZE = "revert_strategize" to REVERT = "revert" in the RecoveryAction enum (and update all references), OR
  2. Add a serialization alias so the JSON output uses "revert" while the internal name remains REVERT_STRATEGIZE

The spec clearly shows "action": "revert" as the expected value.


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

## Bug Report **Feature Area:** Error handling and recovery paths **Command:** `agents plan errors` **Severity:** High — JSON output field value doesn't match spec, breaking API consumers --- ## Expected Behavior (from spec) The spec (§ `agents plan errors`, JSON output, line 15910) shows recovery hint actions as: ```json { "recovery_hints": [ { "action": "retry", "message": "Check sandbox permissions and retry execution", "cli_command": "agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J" }, { "action": "revert", "message": "Revert to Strategize phase to adjust the plan", "cli_command": "agents plan correct --mode revert -g \"...\" <DECISION_ID>" } ] } ``` The `action` field for the revert hint should be `"revert"`. ## Actual Behavior (from code) The `RecoveryAction` enum in `src/cleveragents/domain/models/core/error_recovery.py` defines: ```python class RecoveryAction(StrEnum): RETRY = "retry" REVERT_STRATEGIZE = "revert_strategize" # ← serializes as "revert_strategize" CORRECT = "correct" PROMPT = "prompt" CANCEL = "cancel" MANUAL = "manual" ``` When the `plan errors` command outputs recovery hints in JSON format (line 2346 in `plan.py`): ```python entry: dict[str, Any] = { "action": h.action.value, # ← outputs "revert_strategize" not "revert" "message": h.message, } ``` This means the JSON output will contain `"action": "revert_strategize"` instead of the spec-required `"action": "revert"`. ## Impact - API consumers parsing the JSON output will receive `revert_strategize` instead of `revert` - Breaks the spec contract for the `plan errors` command - Any tooling that checks `action == "revert"` will fail to match ## Code Location - `src/cleveragents/domain/models/core/error_recovery.py` — `RecoveryAction` enum (lines 69–91) - `src/cleveragents/cli/commands/plan.py` — `plan_errors` handler (lines 2344–2350) ## Fix Required Either: 1. Rename `REVERT_STRATEGIZE = "revert_strategize"` to `REVERT = "revert"` in the `RecoveryAction` enum (and update all references), OR 2. Add a serialization alias so the JSON output uses `"revert"` while the internal name remains `REVERT_STRATEGIZE` The spec clearly shows `"action": "revert"` as the expected value. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 17:41:39 +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#4579
No description provided.