Refactor: Improper exception handling in PlanExecutor #3233

Closed
opened 2026-04-05 08:09:27 +00:00 by freemo · 1 comment
Owner

During a recent scan of the codebase, several violations of the error handling guidelines were found in src/cleveragents/application/services/plan_executor.py.

The CONTRIBUTING.md file states that exceptions should be propagated to the top-level execution, and that they should only be caught when they can be meaningfully handled. Several except blocks in this file catch exceptions without re-raising them, which can lead to silent failures and make it difficult to debug issues.

Violations

  • _try_emit_metric: Catches and logs Exception without re-raising.
  • _try_create_checkpoint: Catches and logs Exception without re-raising.
  • _try_rollback_to_last_checkpoint: Catches and logs Exception without re-raising.
  • _run_execute_with_stub: Catches and logs Exception and continues to the next iteration of the loop, which can hide the original error.

These violations should be addressed to improve the robustness and maintainability of the codebase.


Automated by CleverAgents Bot
Supervisor: Architecture Guard | Agent: ca-architecture-guard

During a recent scan of the codebase, several violations of the error handling guidelines were found in `src/cleveragents/application/services/plan_executor.py`. The `CONTRIBUTING.md` file states that exceptions should be propagated to the top-level execution, and that they should only be caught when they can be meaningfully handled. Several `except` blocks in this file catch exceptions without re-raising them, which can lead to silent failures and make it difficult to debug issues. ### Violations - **`_try_emit_metric`**: Catches and logs `Exception` without re-raising. - **`_try_create_checkpoint`**: Catches and logs `Exception` without re-raising. - **`_try_rollback_to_last_checkpoint`**: Catches and logs `Exception` without re-raising. - **`_run_execute_with_stub`**: Catches and logs `Exception` and continues to the next iteration of the loop, which can hide the original error. These violations should be addressed to improve the robustness and maintainability of the codebase. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: ca-architecture-guard
Author
Owner

Closing as duplicate of #3155 (Refactor: Replace broad exception handling with specific exception types).

#3155 already covers the broader scope of replacing all broad exception handling across the codebase, which includes the PlanExecutor violations listed here. The work in this issue is a subset of #3155.


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

Closing as duplicate of #3155 (Refactor: Replace broad exception handling with specific exception types). #3155 already covers the broader scope of replacing all broad exception handling across the codebase, which includes the `PlanExecutor` violations listed here. The work in this issue is a subset of #3155. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo 2026-04-05 08:39:13 +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#3233
No description provided.