UAT: retry_auto_debug decorator and RetryContext context manager are dead code — defined but never used in production code #4030

Open
opened 2026-04-06 08:48:37 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/retire-dead-retry-auto-debug-and-retry-context-abstractions
  • Commit Message: fix(retry): integrate retry_auto_debug and RetryContext into plan execution pipeline
  • Milestone: None (backlog)
  • Parent Epic: #368

What Was Tested

  • Searched entire codebase for retry_auto_debug usage outside of definition/export files — zero matches found
  • Searched entire codebase for RetryContext usage outside of definition/export files — zero matches found
  • Both are re-exported from src/cleveragents/core/retry_patterns.py (lines 437, 458) and listed in __all__ (lines 472, 477)
  • Both have comprehensive implementations with retry logic, logging, and error handling

Bug Description

retry_auto_debug (in src/cleveragents/core/retry_service_patterns.py:543) and RetryContext (in src/cleveragents/core/retry_service_patterns.py:356) are fully implemented, exported from retry_patterns.py, and documented — but they are never used anywhere in the production codebase.

retry_auto_debug description (from docstring):

Retry with auto-debug capability for plan execution. Wraps an async callable so that it is retried up to max_debug_attempts times. Between attempts an optional debug_callback is invoked to attempt automated repair.

This is specifically designed for plan execution retry with automated debugging — a key feature of the error recovery system. But it is never applied to any plan execution function.

RetryContext description (from docstring):

Context manager for retry operations with state tracking.

This provides a context manager interface for retry operations with execute() and async_execute() methods. It is never used in production code.

Expected Behavior

These utilities should be used in the plan execution pipeline:

  • retry_auto_debug should wrap the plan execution actor calls to provide automated retry with debugging between attempts
  • RetryContext should be used where retry state tracking is needed (e.g., in the execute phase retry loop)

Actual Behavior

Both are dead code. The plan executor uses a manual for attempt in range(max_attempts) loop instead of these abstractions.

Code Locations

  • src/cleveragents/core/retry_service_patterns.py:356-540RetryContext class (dead code)
  • src/cleveragents/core/retry_service_patterns.py:543-643retry_auto_debug function (dead code)
  • src/cleveragents/core/retry_patterns.py:437,458 — re-exports (dead exports)
  • src/cleveragents/application/services/plan_executor.py:747-811 — manual retry loop that should use these abstractions

Subtasks

  • Add a TDD issue-capture Behave scenario proving retry_auto_debug is never applied to any plan execution callable
  • Add a TDD issue-capture Behave scenario proving RetryContext is never instantiated in production code
  • Replace the manual for attempt in range(max_attempts) loop in plan_executor.py:747-811 with retry_auto_debug wrapping the actor call
  • Integrate RetryContext for retry state tracking in the execute phase where appropriate
  • Remove or update the dead re-exports in retry_patterns.py if any become unused after integration
  • Update unit tests (Behave) to cover the new integration paths
  • Ensure all nox stages pass with coverage >= 97%

Definition of Done

  • retry_auto_debug is applied to at least one plan execution actor call in plan_executor.py
  • RetryContext is used in at least one production code path for retry state tracking
  • The manual for attempt in range(max_attempts) loop in plan_executor.py:747-811 is replaced by the proper retry abstraction
  • TDD issue-capture tests are green (dead code proven before fix, integration passing after fix)
  • No dead exports remain in retry_patterns.py for these symbols
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.5.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


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

## Metadata - **Branch**: `fix/retire-dead-retry-auto-debug-and-retry-context-abstractions` - **Commit Message**: `fix(retry): integrate retry_auto_debug and RetryContext into plan execution pipeline` - **Milestone**: None (backlog) - **Parent Epic**: #368 ## What Was Tested - Searched entire codebase for `retry_auto_debug` usage outside of definition/export files — **zero matches found** - Searched entire codebase for `RetryContext` usage outside of definition/export files — **zero matches found** - Both are re-exported from `src/cleveragents/core/retry_patterns.py` (lines 437, 458) and listed in `__all__` (lines 472, 477) - Both have comprehensive implementations with retry logic, logging, and error handling ## Bug Description `retry_auto_debug` (in `src/cleveragents/core/retry_service_patterns.py:543`) and `RetryContext` (in `src/cleveragents/core/retry_service_patterns.py:356`) are fully implemented, exported from `retry_patterns.py`, and documented — but they are **never used anywhere in the production codebase**. **`retry_auto_debug` description (from docstring):** > Retry with auto-debug capability for plan execution. Wraps an async callable so that it is retried up to max_debug_attempts times. Between attempts an optional debug_callback is invoked to attempt automated repair. This is specifically designed for plan execution retry with automated debugging — a key feature of the error recovery system. But it is never applied to any plan execution function. **`RetryContext` description (from docstring):** > Context manager for retry operations with state tracking. This provides a context manager interface for retry operations with `execute()` and `async_execute()` methods. It is never used in production code. ## Expected Behavior These utilities should be used in the plan execution pipeline: - `retry_auto_debug` should wrap the plan execution actor calls to provide automated retry with debugging between attempts - `RetryContext` should be used where retry state tracking is needed (e.g., in the execute phase retry loop) ## Actual Behavior Both are dead code. The plan executor uses a manual `for attempt in range(max_attempts)` loop instead of these abstractions. ## Code Locations - `src/cleveragents/core/retry_service_patterns.py:356-540` — `RetryContext` class (dead code) - `src/cleveragents/core/retry_service_patterns.py:543-643` — `retry_auto_debug` function (dead code) - `src/cleveragents/core/retry_patterns.py:437,458` — re-exports (dead exports) - `src/cleveragents/application/services/plan_executor.py:747-811` — manual retry loop that should use these abstractions ## Subtasks - [ ] Add a TDD issue-capture Behave scenario proving `retry_auto_debug` is never applied to any plan execution callable - [ ] Add a TDD issue-capture Behave scenario proving `RetryContext` is never instantiated in production code - [ ] Replace the manual `for attempt in range(max_attempts)` loop in `plan_executor.py:747-811` with `retry_auto_debug` wrapping the actor call - [ ] Integrate `RetryContext` for retry state tracking in the execute phase where appropriate - [ ] Remove or update the dead re-exports in `retry_patterns.py` if any become unused after integration - [ ] Update unit tests (Behave) to cover the new integration paths - [ ] Ensure all nox stages pass with coverage >= 97% ## Definition of Done - [ ] `retry_auto_debug` is applied to at least one plan execution actor call in `plan_executor.py` - [ ] `RetryContext` is used in at least one production code path for retry state tracking - [ ] The manual `for attempt in range(max_attempts)` loop in `plan_executor.py:747-811` is replaced by the proper retry abstraction - [ ] TDD issue-capture tests are green (dead code proven before fix, integration passing after fix) - [ ] No dead exports remain in `retry_patterns.py` for these symbols - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.5.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:11:46 +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.

Blocks
#368 Epic: Subplans & Parallelism
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#4030
No description provided.