BUG-HUNT: [error-handling] Silent error in EventBusBridge._on_domain_event #5904

Open
opened 2026-04-09 11:39:26 +00:00 by HAL9000 · 0 comments
Owner

Bug Report: [error-handling] — Silent error in EventBusBridge._on_domain_event

Severity Assessment

  • Impact: Events may be silently dropped if the event queue is closed, which can hide bugs and make debugging difficult.
  • Likelihood: High, as this is the designed behavior.
  • Priority: Medium

Location

  • File: src/cleveragents/a2a/events.py
  • Function/Class: EventBusBridge._on_domain_event
  • Lines: 288-289

Description

The with contextlib.suppress(RuntimeError): in EventBusBridge._on_domain_event will silently drop events if the event queue is closed. This might be the desired behavior in some cases, but it can also hide bugs and make it difficult to debug issues where events are not being processed as expected.

Evidence

        import contextlib

        with contextlib.suppress(RuntimeError):
            self._event_queue.publish(a2a_event)

Expected Behavior

The code should log a warning or an error when an event is dropped because the event queue is closed. This would provide visibility into the fact that events are being dropped and help with debugging.

Actual Behavior

The code silently drops events if the event queue is closed, which can hide bugs and make debugging difficult.

Suggested Fix

Remove the with contextlib.suppress(RuntimeError): and instead use a try...except RuntimeError: block to catch the exception and log a warning or an error message.

Category

error-handling

TDD Note

After this bug issue is verified, a corresponding Type/Testing issue will be
created for TDD. The test will use tags: @tdd_issue, @tdd_issue_,
and @tdd_expected_fail to prove the bug exists before fixing it.


Automated by CleverAgents Bot
Supervisor: Bug Hunting | Agent: bug-hunter

## Bug Report: [error-handling] — Silent error in EventBusBridge._on_domain_event ### Severity Assessment - **Impact**: Events may be silently dropped if the event queue is closed, which can hide bugs and make debugging difficult. - **Likelihood**: High, as this is the designed behavior. - **Priority**: Medium ### Location - **File**: `src/cleveragents/a2a/events.py` - **Function/Class**: `EventBusBridge._on_domain_event` - **Lines**: 288-289 ### Description The `with contextlib.suppress(RuntimeError):` in `EventBusBridge._on_domain_event` will silently drop events if the event queue is closed. This might be the desired behavior in some cases, but it can also hide bugs and make it difficult to debug issues where events are not being processed as expected. ### Evidence ```python import contextlib with contextlib.suppress(RuntimeError): self._event_queue.publish(a2a_event) ``` ### Expected Behavior The code should log a warning or an error when an event is dropped because the event queue is closed. This would provide visibility into the fact that events are being dropped and help with debugging. ### Actual Behavior The code silently drops events if the event queue is closed, which can hide bugs and make debugging difficult. ### Suggested Fix Remove the `with contextlib.suppress(RuntimeError):` and instead use a `try...except RuntimeError:` block to catch the exception and log a warning or an error message. ### Category error-handling ### TDD Note After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: @tdd_issue, @tdd_issue_<this-issue-number>, and @tdd_expected_fail to prove the bug exists before fixing it. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunting | Agent: bug-hunter
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.

Reference
cleveragents/cleveragents-core#5904
No description provided.