bug(application): Error suppression in BindingResolutionService violates CONTRIBUTING.md #9080

Open
opened 2026-04-14 07:18:33 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Commit Message: fix(application): Stop suppressing NotFoundError in BindingResolutionService
  • Branch: bugfix/m-error-suppression-binding-resolution-service

Background and Context

The BindingResolutionService in binding_resolution_service.py suppresses NotFoundError exceptions, which is a direct violation of the error handling guidelines in CONTRIBUTING.md.

Current Behavior

The _find_matching_resources method in BindingResolutionService has a try...except NotFoundError block that catches the exception and simply continues the loop. This means that if a project has a linked resource that has been deleted from the resource registry, the binding resolution service will silently ignore it. This can lead to a situation where a tool slot is not bound, and the user is not given any indication as to why.

Code Evidence:

# src/cleveragents/application/services/binding_resolution_service.py:293
            try:
                resource = self._registry.show_resource(
                    link.resource_id,
                )
            except NotFoundError:
                continue

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 NotFoundError should not be suppressed. It should either be allowed to propagate up the call stack, or it should be logged as a warning so that the user is aware that a linked resource is missing.

Acceptance Criteria

  • The try...except NotFoundError block in _find_matching_resources is removed or modified to log a warning.
  • Missing linked resources are no longer silently ignored.

Subtasks

  • Modify the exception handling in _find_matching_resources to not suppress NotFoundError.
  • Consider adding a warning log message when a linked resource is not found.
  • Tests (Behave): Add scenarios to verify that a missing linked resource is handled 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 NotFoundError in BindingResolutionService` - **Branch**: `bugfix/m-error-suppression-binding-resolution-service` ## Background and Context The `BindingResolutionService` in `binding_resolution_service.py` suppresses `NotFoundError` exceptions, which is a direct violation of the error handling guidelines in `CONTRIBUTING.md`. ## Current Behavior The `_find_matching_resources` method in `BindingResolutionService` has a `try...except NotFoundError` block that catches the exception and simply continues the loop. This means that if a project has a linked resource that has been deleted from the resource registry, the binding resolution service will silently ignore it. This can lead to a situation where a tool slot is not bound, and the user is not given any indication as to why. **Code Evidence:** ```python # src/cleveragents/application/services/binding_resolution_service.py:293 try: resource = self._registry.show_resource( link.resource_id, ) except NotFoundError: continue ``` **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 `NotFoundError` should not be suppressed. It should either be allowed to propagate up the call stack, or it should be logged as a warning so that the user is aware that a linked resource is missing. ## Acceptance Criteria - The `try...except NotFoundError` block in `_find_matching_resources` is removed or modified to log a warning. - Missing linked resources are no longer silently ignored. ## Subtasks - [ ] Modify the exception handling in `_find_matching_resources` to not suppress `NotFoundError`. - [ ] Consider adding a warning log message when a linked resource is not found. - [ ] Tests (Behave): Add scenarios to verify that a missing linked resource is handled 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.0.0 milestone 2026-04-14 07:21:58 +00:00
HAL9000 modified the milestone from v3.0.0 to v3.4.0 2026-04-14 07:37:27 +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#9080
No description provided.