UAT: Silent exception suppression in use_action() hides config service lookup failures #3873

Open
opened 2026-04-06 07:04:47 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/use-action-silent-exception-suppression
  • Commit Message: fix(plan-lifecycle): replace silent exception suppression in use_action() with debug logging
  • Milestone: (backlog — see note below)
  • Parent Epic: #362

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

Bug Report

Feature Area: Error Handling and Resilience
Severity: Medium
Found by: UAT automated testing

What Was Tested

The use_action() method in src/cleveragents/application/services/plan_lifecycle_service.py (lines 1050-1057) was analyzed for compliance with the CONTRIBUTING.md exception propagation rules.

Expected Behavior (from CONTRIBUTING.md)

Errors must never be suppressed. Exceptions should be allowed to propagate up to the top-level execution handler.
Catch-all exception handlers should not be used unless they re-raise the exception.
Exceptions should only be caught when there is a meaningful way to handle them.

Actual Behavior

The use_action() method silently swallows all exceptions when resolving the default estimation actor from config with a bare except Exception: pass:

# src/cleveragents/application/services/plan_lifecycle_service.py lines 1050-1057
        resolved_estimation_actor: str | None = action.estimation_actor
        if not resolved_estimation_actor and self._config_service is not None:
            try:
                cfg_result = self._config_service.resolve("actor.default.estimation")
                if isinstance(cfg_result.value, str) and cfg_result.value.strip():
                    resolved_estimation_actor = cfg_result.value.strip()
            except Exception:
                pass  # Config lookup failure is non-fatal  <-- VIOLATION

Why This Is a Problem

  1. No logging: If the config service raises (e.g., database error, invalid config key), there is zero diagnostic information.
  2. Violates CONTRIBUTING.md: The rule states exceptions should only be caught when there is a meaningful recovery action. A bare pass is not meaningful.
  3. Masks configuration issues: If the config service is broken or misconfigured, this silently hides the problem. The plan proceeds without the intended estimation actor.
  4. Inconsistent with other patterns: Other similar "best-effort" operations in the same file use self._logger.warning(...) with exc_info=True, which is the correct pattern.

Replace the bare pass with a debug-level log consistent with the rest of the file:

            except Exception:
                self._logger.debug(
                    "config_estimation_actor_lookup_failed",
                    exc_info=True,
                )

Code Location

  • File: src/cleveragents/application/services/plan_lifecycle_service.py
  • Lines: 1050-1057
  • Method: use_action()

Subtasks

  • Replace bare except Exception: pass with self._logger.debug("config_estimation_actor_lookup_failed", exc_info=True) in use_action()
  • Audit plan_lifecycle_service.py for any other bare except: pass or except Exception: pass patterns that violate the same rule
  • Tests (Behave): Add/update scenario to verify that a config service exception during use_action() is logged at DEBUG level and does not propagate
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

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

## Metadata - **Branch**: `fix/use-action-silent-exception-suppression` - **Commit Message**: `fix(plan-lifecycle): replace silent exception suppression in use_action() with debug logging` - **Milestone**: *(backlog — see note below)* - **Parent Epic**: #362 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Bug Report **Feature Area:** Error Handling and Resilience **Severity:** Medium **Found by:** UAT automated testing ### What Was Tested The `use_action()` method in `src/cleveragents/application/services/plan_lifecycle_service.py` (lines 1050-1057) was analyzed for compliance with the CONTRIBUTING.md exception propagation rules. ### Expected Behavior (from CONTRIBUTING.md) > Errors must **never** be suppressed. Exceptions should be allowed to propagate up to the top-level execution handler. > Catch-all exception handlers should not be used unless they re-raise the exception. > Exceptions should only be caught when there is a meaningful way to handle them. ### Actual Behavior The `use_action()` method silently swallows all exceptions when resolving the default estimation actor from config with a bare `except Exception: pass`: ```python # src/cleveragents/application/services/plan_lifecycle_service.py lines 1050-1057 resolved_estimation_actor: str | None = action.estimation_actor if not resolved_estimation_actor and self._config_service is not None: try: cfg_result = self._config_service.resolve("actor.default.estimation") if isinstance(cfg_result.value, str) and cfg_result.value.strip(): resolved_estimation_actor = cfg_result.value.strip() except Exception: pass # Config lookup failure is non-fatal <-- VIOLATION ``` ### Why This Is a Problem 1. **No logging**: If the config service raises (e.g., database error, invalid config key), there is zero diagnostic information. 2. **Violates CONTRIBUTING.md**: The rule states exceptions should only be caught when there is a meaningful recovery action. A bare `pass` is not meaningful. 3. **Masks configuration issues**: If the config service is broken or misconfigured, this silently hides the problem. The plan proceeds without the intended estimation actor. 4. **Inconsistent with other patterns**: Other similar "best-effort" operations in the same file use `self._logger.warning(...)` with `exc_info=True`, which is the correct pattern. ### Recommended Fix Replace the bare `pass` with a debug-level log consistent with the rest of the file: ```python except Exception: self._logger.debug( "config_estimation_actor_lookup_failed", exc_info=True, ) ``` ### Code Location - File: `src/cleveragents/application/services/plan_lifecycle_service.py` - Lines: 1050-1057 - Method: `use_action()` ## Subtasks - [ ] Replace bare `except Exception: pass` with `self._logger.debug("config_estimation_actor_lookup_failed", exc_info=True)` in `use_action()` - [ ] Audit `plan_lifecycle_service.py` for any other bare `except: pass` or `except Exception: pass` patterns that violate the same rule - [ ] Tests (Behave): Add/update scenario to verify that a config service exception during `use_action()` is logged at DEBUG level and does not propagate - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
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
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3873
No description provided.