bug(application): Error suppression in CheckpointService violates CONTRIBUTING.md #9086

Open
opened 2026-04-14 07:23:23 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit Message: fix(application): Stop suppressing exceptions in CheckpointService._compute_diff_snapshot
  • Branch: bugfix/m-error-suppression-checkpoint-service

Background and Context

The CheckpointService in checkpoint_service.py suppresses exceptions in the _compute_diff_snapshot method, which is a direct violation of the error handling guidelines in CONTRIBUTING.md.

Current Behavior

The _compute_diff_snapshot method has a try...except Exception block that catches any exception that occurs during the git diff operation and returns an empty list. This suppresses the error and can hide underlying issues with the git repository or the git command.

Code Evidence:

# src/cleveragents/application/services/checkpoint_service.py:627
        try:
            result = self._run_git(
                ["diff", "--name-only", previous_ref, current_ref],
                cwd=sandbox_path,
            )
            return [line for line in result.stdout.strip().splitlines() if line]
        except Exception:
            logger.warning(
                "checkpoint.diff_computation_failed",
                extra={
                    "plan_id": plan_id,
                    "previous_ref": previous_ref,
                    "current_ref": current_ref,
                },
                exc_info=True,
            )
            return []

Violation of CONTRIBUTING.md:

The CONTRIBUTING.md file explicitly states: "CRITICAL: Do not suppress errors. Let exceptions propagate to top-level execution."

Expected Behavior

The exception should not be suppressed. It should be logged, but it would be even better to let it propagate so that the caller is aware that the diff computation failed.

Acceptance Criteria

  • The try...except Exception block in _compute_diff_snapshot is modified to not suppress the exception.
  • The exception is logged with exc_info=True.

Subtasks

  • Modify the exception handling in _compute_diff_snapshot to re-raise the exception after logging it.
  • Tests (Behave): Add scenarios to verify that an exception during diff computation is propagated correctly.
  • 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.

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `fix(application): Stop suppressing exceptions in CheckpointService._compute_diff_snapshot` - **Branch**: `bugfix/m-error-suppression-checkpoint-service` ## Background and Context The `CheckpointService` in `checkpoint_service.py` suppresses exceptions in the `_compute_diff_snapshot` method, which is a direct violation of the error handling guidelines in `CONTRIBUTING.md`. ## Current Behavior The `_compute_diff_snapshot` method has a `try...except Exception` block that catches any exception that occurs during the `git diff` operation and returns an empty list. This suppresses the error and can hide underlying issues with the git repository or the `git` command. **Code Evidence:** ```python # src/cleveragents/application/services/checkpoint_service.py:627 try: result = self._run_git( ["diff", "--name-only", previous_ref, current_ref], cwd=sandbox_path, ) return [line for line in result.stdout.strip().splitlines() if line] except Exception: logger.warning( "checkpoint.diff_computation_failed", extra={ "plan_id": plan_id, "previous_ref": previous_ref, "current_ref": current_ref, }, exc_info=True, ) return [] ``` **Violation of CONTRIBUTING.md:** The `CONTRIBUTING.md` file explicitly states: "**CRITICAL: Do not suppress errors. Let exceptions propagate to top-level execution.**" ## Expected Behavior The exception should not be suppressed. It should be logged, but it would be even better to let it propagate so that the caller is aware that the diff computation failed. ## Acceptance Criteria - The `try...except Exception` block in `_compute_diff_snapshot` is modified to not suppress the exception. - The exception is logged with `exc_info=True`. ## Subtasks - [ ] Modify the exception handling in `_compute_diff_snapshot` to re-raise the exception after logging it. - [ ] Tests (Behave): Add scenarios to verify that an exception during diff computation is propagated correctly. - [ ] 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. --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.3.0 milestone 2026-04-14 07:37:29 +00:00
Author
Owner

🔍 Triage Decision — [AUTO-OWNR-2]

Status: VERIFIED

MoSCoW: Should have
Priority: Medium
Milestone: v3.3.0

Reasoning: Error suppression in CheckpointService violates CONTRIBUTING.md guidelines on exception handling, which can hide failures and make debugging harder. Should be fixed to maintain code quality standards.


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

## 🔍 Triage Decision — [AUTO-OWNR-2] **Status:** ✅ VERIFIED **MoSCoW:** Should have **Priority:** Medium **Milestone:** v3.3.0 **Reasoning:** Error suppression in `CheckpointService` violates CONTRIBUTING.md guidelines on exception handling, which can hide failures and make debugging harder. Should be fixed to maintain code quality standards. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Author
Owner

Triage: Verified [AUTO-OWNR-1]

Valid bug: CheckpointService suppresses errors in violation of CONTRIBUTING.md's exception propagation rules. Silent error suppression makes debugging difficult and can hide real failures.

Assigning to v3.3.0 (Corrections + Subplans + Checkpoints) as CheckpointService is a core M4 component. Priority Medium — error suppression violates project standards.

MoSCoW: Should Have — proper error propagation is required by CONTRIBUTING.md and is important for debugging.


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

✅ **Triage: Verified** [AUTO-OWNR-1] Valid bug: `CheckpointService` suppresses errors in violation of CONTRIBUTING.md's exception propagation rules. Silent error suppression makes debugging difficult and can hide real failures. Assigning to **v3.3.0** (Corrections + Subplans + Checkpoints) as `CheckpointService` is a core M4 component. Priority **Medium** — error suppression violates project standards. MoSCoW: **Should Have** — proper error propagation is required by CONTRIBUTING.md and is important for debugging. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#9086
No description provided.