UAT: FixThenRevalidateOrchestrator injected into PlanExecutor but run_fix_loop() is never called — fix-then-revalidate loop is dead code #6033

Open
opened 2026-04-09 13:54:52 +00:00 by HAL9000 · 2 comments
Owner

Summary

PlanExecutor accepts a fix_revalidate_orchestrator parameter and stores it as self._fix_revalidate_orchestrator, but this orchestrator is never invoked anywhere in the execute flow. The fix-then-revalidate loop — which is supposed to automatically fix required validation failures and retry — is completely non-functional.

What Was Tested

  • Code-level analysis of src/cleveragents/application/services/plan_executor.py
  • Grep for all usages of _fix_revalidate_orchestrator in the file

Expected Behavior (from spec §Validation Failure Handling)

When a required validation fails during Execute:

  1. The execution actor diagnoses the failure
  2. Attempts to fix the underlying issue within strategy constraints
  3. Re-runs the failing validation
  4. Repeats up to max_retries times (default 3)
  5. If still failing: escalates to strategy revision or user escalation

The FixThenRevalidateOrchestrator.run_fix_loop() is the implementation of this loop.

Actual Behavior

# plan_executor.py — all usages of _fix_revalidate_orchestrator:
# Line 365: self._fix_revalidate_orchestrator = fix_revalidate_orchestrator  (stored)
# Line 422: return self._fix_revalidate_orchestrator  (property getter)
# 
# NEVER called in _run_execute_with_stub() or _run_execute_with_runtime()

The orchestrator is injected via dependency injection and exposed as a property, but no code in the execute flow ever calls self._fix_revalidate_orchestrator.run_fix_loop(...).

Impact

  • Required validation failures are never automatically fixed
  • The retry loop (up to 3 attempts per spec) never runs
  • Plans with fixable validation failures immediately fail instead of attempting recovery
  • The FixThenRevalidateOrchestrator implementation (which is complete and well-tested) is dead code in production

Code Location

  • src/cleveragents/application/services/plan_executor.py — lines 318, 344, 365, 418-422
  • src/cleveragents/application/services/fix_then_revalidate.pyFixThenRevalidateOrchestrator.run_fix_loop() (complete implementation, never called)

Relationship to #6016

This bug is closely related to #6016 (ValidationPipeline not integrated). Both bugs must be fixed together:

  1. First, wire ValidationPipeline into the execute flow (#6016)
  2. Then, when required validations fail, call run_fix_loop() with appropriate fix and revalidate callbacks

Fix Required

After running the ValidationPipeline and detecting required failures, PlanExecutor should call:

if self._fix_revalidate_orchestrator is not None and summary.required_failed > 0:
    failed_results = [r for r in summary.results if r.mode == ValidationMode.REQUIRED and not r.passed]
    fix_result = self._fix_revalidate_orchestrator.run_fix_loop(
        plan_id=plan_id,
        failed_results=failed_results,
        fix_callback=...,       # actor attempts to fix the issue
        revalidate_callback=..., # re-runs the specific validation
    )
    if not fix_result.final_passed:
        # escalate or fail the plan

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

## Summary `PlanExecutor` accepts a `fix_revalidate_orchestrator` parameter and stores it as `self._fix_revalidate_orchestrator`, but this orchestrator is **never invoked** anywhere in the execute flow. The fix-then-revalidate loop — which is supposed to automatically fix required validation failures and retry — is completely non-functional. ## What Was Tested - Code-level analysis of `src/cleveragents/application/services/plan_executor.py` - Grep for all usages of `_fix_revalidate_orchestrator` in the file ## Expected Behavior (from spec §Validation Failure Handling) When a required validation fails during Execute: 1. The execution actor diagnoses the failure 2. Attempts to fix the underlying issue within strategy constraints 3. Re-runs the failing validation 4. Repeats up to `max_retries` times (default 3) 5. If still failing: escalates to strategy revision or user escalation The `FixThenRevalidateOrchestrator.run_fix_loop()` is the implementation of this loop. ## Actual Behavior ```python # plan_executor.py — all usages of _fix_revalidate_orchestrator: # Line 365: self._fix_revalidate_orchestrator = fix_revalidate_orchestrator (stored) # Line 422: return self._fix_revalidate_orchestrator (property getter) # # NEVER called in _run_execute_with_stub() or _run_execute_with_runtime() ``` The orchestrator is injected via dependency injection and exposed as a property, but no code in the execute flow ever calls `self._fix_revalidate_orchestrator.run_fix_loop(...)`. ## Impact - Required validation failures are never automatically fixed - The retry loop (up to 3 attempts per spec) never runs - Plans with fixable validation failures immediately fail instead of attempting recovery - The `FixThenRevalidateOrchestrator` implementation (which is complete and well-tested) is dead code in production ## Code Location - `src/cleveragents/application/services/plan_executor.py` — lines 318, 344, 365, 418-422 - `src/cleveragents/application/services/fix_then_revalidate.py` — `FixThenRevalidateOrchestrator.run_fix_loop()` (complete implementation, never called) ## Relationship to #6016 This bug is closely related to #6016 (`ValidationPipeline` not integrated). Both bugs must be fixed together: 1. First, wire `ValidationPipeline` into the execute flow (#6016) 2. Then, when required validations fail, call `run_fix_loop()` with appropriate fix and revalidate callbacks ## Fix Required After running the `ValidationPipeline` and detecting required failures, `PlanExecutor` should call: ```python if self._fix_revalidate_orchestrator is not None and summary.required_failed > 0: failed_results = [r for r in summary.results if r.mode == ValidationMode.REQUIRED and not r.passed] fix_result = self._fix_revalidate_orchestrator.run_fix_loop( plan_id=plan_id, failed_results=failed_results, fix_callback=..., # actor attempts to fix the issue revalidate_callback=..., # re-runs the specific validation ) if not fix_result.final_passed: # escalate or fail the plan ``` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 13:59:45 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone 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 and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Author
Owner

MoSCoW classification: Must Have

Rationale: This is a Priority/Critical bug — FixThenRevalidateOrchestrator is injected into PlanExecutor but run_fix_loop() is never called. This means the fix-then-revalidate orchestration (a core part of the plan execution pipeline) is completely non-functional. The spec requires validation-gated apply with fix loops. This directly blocks v3.5.0 acceptance criteria.


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

MoSCoW classification: **Must Have** Rationale: This is a `Priority/Critical` bug — `FixThenRevalidateOrchestrator` is injected into `PlanExecutor` but `run_fix_loop()` is never called. This means the fix-then-revalidate orchestration (a core part of the plan execution pipeline) is completely non-functional. The spec requires validation-gated apply with fix loops. This directly blocks v3.5.0 acceptance criteria. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: 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.

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