UAT: agents plan correct --mode revert never restores actor reasoning state — decisions parameter not passed to execute_correction, actor_state_ref always empty #3108

Open
opened 2026-04-05 06:18:40 +00:00 by freemo · 1 comment
Owner

Summary

The agents plan correct --mode revert CLI command never passes the decisions mapping to execute_correction(). As a result, _extract_actor_state_ref() always returns "" and the actor_state_ref field in CorrectionResult is always empty. The reasoning rollback step (restoring the LangGraph actor's conversation history and graph state) is effectively disabled for all CLI-initiated corrections.

Metadata

  • Branch: fix/plan-correct-pass-decisions-to-execute-correction
  • Commit Message: fix(cli): pass decisions mapping to execute_correction for actor state restoration
  • Milestone: v3.2.0
  • Parent Epic: #394

Subtasks

  • Fetch the decisions mapping from DecisionService in correct_decision() in plan.py
  • Pass decisions to svc.execute_correction() call
  • Add Behave unit test verifying actor_state_ref is populated when decisions have context snapshots
  • Add Robot Framework integration test verifying reasoning rollback metadata is returned

Definition of Done

  • CorrectionResult.actor_state_ref is populated with the target decision's context_snapshot.actor_state_ref when the decision has one
  • All existing tests pass
  • All nox stages pass
  • Coverage e= 97%

Bug Details

What was tested

Code analysis of src/cleveragents/cli/commands/plan.py lines 3108 3113 and src/cleveragents/application/services/correction_service.py lines 889 914

Expected behavior (from spec § Correction Flow, Revert Mode)

 Reasoning rollback: Extracts the actor_state_ref from the target decision's context_snapshot and returns it in the result so downstream consumers can restore the LangGraph actor's reasoning state.

The Decision should contain the actor_state_ref

Actual behavior

The CLI calls execute_correction without the decisions parameter:

# src/cleveragents/cli/commands/plan.py lines 3108-3113
result = svc.execute_correction(
    request.correction_id,
    decision_tree=decision_tree,
    influence_edges=influence_edges,
    # decisions= is MISSING — never passed
)

The _extract_actor_state_ref method returns "" when decisions is None:

# correction_service.py lines 907-914
@staticmethod
def _extract_actor_state_ref(target_decision_id, decisions):
    if decisions is None:
        return ""  # ← always returns "" because decisions is never passed
    ...

Code locations

  • src/cleveragents/cli/commands/plan.py, function correct_decision(), lines 3108 3113
  • src/cleveragents/application/services/correction_service.py, method _extract_actor_state_ref(), lines 889 914

Steps to reproduce

  1. Create a plan with decisions that have context_snapshot.actor_state_ref set
  2. Run: agents plan correct cdecision_ide --mode revert --guidance "test" --yes
  3. Observe that actor_state_ref in the result is always "" regardless of the decision's context snapshot

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Summary The `agents plan correct --mode revert` CLI command never passes the `decisions` mapping to `execute_correction()`. As a result, `_extract_actor_state_ref()` always returns `""` and the `actor_state_ref` field in `CorrectionResult` is always empty. The reasoning rollback step (restoring the LangGraph actor's conversation history and graph state) is effectively disabled for all CLI-initiated corrections. ## Metadata - **Branch**: `fix/plan-correct-pass-decisions-to-execute-correction` - **Commit Message**: `fix(cli): pass decisions mapping to execute_correction for actor state restoration` - **Milestone**: v3.2.0 - **Parent Epic**: #394 ## Subtasks - [ ] Fetch the `decisions` mapping from `DecisionService` in `correct_decision()` in `plan.py` - [ ] Pass `decisions` to `svc.execute_correction()` call - [ ] Add Behave unit test verifying `actor_state_ref` is populated when decisions have context snapshots - [ ] Add Robot Framework integration test verifying reasoning rollback metadata is returned ## Definition of Done - `CorrectionResult.actor_state_ref` is populated with the target decision's `context_snapshot.actor_state_ref` when the decision has one - All existing tests pass - All nox stages pass - Coverage e= 97% ## Bug Details ### What was tested Code analysis of `src/cleveragents/cli/commands/plan.py` lines 3108 3113 and `src/cleveragents/application/services/correction_service.py` lines 889 914 ### Expected behavior (from spec § Correction Flow, Revert Mode)  **Reasoning rollback**: Extracts the `actor_state_ref` from the target decision's `context_snapshot` and returns it in the result so downstream consumers can restore the LangGraph actor's reasoning state. The `Decision` should contain the actor_state_ref ### Actual behavior The CLI calls `execute_correction` without the `decisions` parameter: ```python # src/cleveragents/cli/commands/plan.py lines 3108-3113 result = svc.execute_correction( request.correction_id, decision_tree=decision_tree, influence_edges=influence_edges, # decisions= is MISSING — never passed ) ``` The `_extract_actor_state_ref` method returns `""` when `decisions` is None: ```python # correction_service.py lines 907-914 @staticmethod def _extract_actor_state_ref(target_decision_id, decisions): if decisions is None: return "" # ← always returns "" because decisions is never passed ... ``` ### Code locations - `src/cleveragents/cli/commands/plan.py`, function `correct_decision()`, lines 3108 3113 - `src/cleveragents/application/services/correction_service.py`, method `_extract_actor_state_ref()`, lines 889 914 ### Steps to reproduce 1. Create a plan with decisions that have `context_snapshot.actor_state_ref` set 2. Run: `agents plan correct cdecision_ide --mode revert --guidance "test" --yes` 3. Observe that `actor_state_ref` in the result is always `""` regardless of the decision's context snapshot --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.2.0 milestone 2026-04-05 06:18:47 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Critical (keeping existing — reasoning rollback is a core correction feature)
  • Milestone: v3.2.0 (already assigned, keeping)
  • MoSCoW: Must Have — the spec requires reasoning rollback to extract actor_state_ref from the target decision's context snapshot. Without this, the LangGraph actor's state is never restored during corrections.
  • Parent Epic: #394 (Decision Framework)

Part of the correction-flow bug cluster (#3107, #3108, #3109, #3113, #3114).


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

Issue triaged by project owner: - **State**: Verified - **Priority**: Critical (keeping existing — reasoning rollback is a core correction feature) - **Milestone**: v3.2.0 (already assigned, keeping) - **MoSCoW**: Must Have — the spec requires reasoning rollback to extract `actor_state_ref` from the target decision's context snapshot. Without this, the LangGraph actor's state is never restored during corrections. - **Parent Epic**: #394 (Decision Framework) Part of the correction-flow bug cluster (#3107, #3108, #3109, #3113, #3114). --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-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.

Blocks
#394 Epic: Decision Framework
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3108
No description provided.